Skip to content

Commit 330e294

Browse files
adanilowski-dropboxjtreminio-dropboxmchatlas-hellosignsainishm2suchcicki-dropbox
authored
Merge main to oas release (#535)
Co-authored-by: Juan Treminio <50673996+jtreminio-dropbox@users.noreply.github.com> Co-authored-by: mchatlas-hellosign <mchatlas@dropbox.com> Co-authored-by: Juan Treminio <juantreminio@dropbox.com> Co-authored-by: Sainish Momin <130490494+sainishm2@users.noreply.github.com> Co-authored-by: suchcicki-dropbox <suchcicki@dropbox.com> Co-authored-by: agornydbx <agorny@dropbox.com> Co-authored-by: mwojcik-dropbox <mwojcik@dropbox.com> Co-authored-by: Brian Erkkinen <brianerkkinen@hellosign.com>
1 parent 2f1fb93 commit 330e294

537 files changed

Lines changed: 21292 additions & 1393 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bin/copy-examples-filtered

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copies example files from src_dir to dst_dir, skipping any whose operationId
4+
# exists in openapi-raw.yaml but not in openapi-sdk.yaml (i.e. endpoints hidden
5+
# from the SDK via the x-hideOn: sdk attribute). Matching is by PascalCase
6+
# filename: an operationId "templateUpdate" maps to "TemplateUpdateExample.<ext>".
7+
8+
set -e
9+
10+
DIR=$(cd "$(dirname "$0")" && pwd)
11+
ROOT_DIR="${DIR}/.."
12+
13+
SRC_DIR="$1"
14+
DST_DIR="$2"
15+
EXT="$3"
16+
17+
if [[ -z "$SRC_DIR" || -z "$DST_DIR" || -z "$EXT" ]]; then
18+
printf "Usage: copy-examples-filtered <src_dir> <dst_dir> <file_extension>\n"
19+
exit 1
20+
fi
21+
22+
HIDDEN_PASCALS=()
23+
while IFS= read -r OP; do
24+
[ -z "$OP" ] && continue
25+
HIDDEN_PASCALS+=("$(echo "${OP:0:1}" | tr 'a-z' 'A-Z')${OP:1}")
26+
done < <(comm -23 \
27+
<(grep 'operationId:' "${ROOT_DIR}/openapi-raw.yaml" | sed 's/.*operationId: //' | sort) \
28+
<(grep 'operationId:' "${ROOT_DIR}/openapi-sdk.yaml" | sed 's/.*operationId: //' | sort))
29+
30+
for FILE in "${SRC_DIR}"/*."${EXT}"; do
31+
[ -f "$FILE" ] || continue
32+
BASENAME=$(basename "$FILE" ".$EXT")
33+
34+
SKIP=0
35+
for PASCAL in "${HIDDEN_PASCALS[@]}"; do
36+
if [ "$BASENAME" = "${PASCAL}Example" ]; then
37+
SKIP=1
38+
printf " Skipping (hidden from SDK): %s\n" "$(basename "$FILE")"
39+
break
40+
fi
41+
done
42+
43+
if [ $SKIP -eq 0 ]; then
44+
cp "$FILE" "$DST_DIR/"
45+
fi
46+
done

bin/redoc-container

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
#
3+
# instructions:
4+
# run this script
5+
# open http://127.0.0.1:8081
6+
#
7+
# Prefer to use ./redoc - this version does not auto-reload changes
8+
9+
set -e
10+
11+
DIR=$(cd `dirname $0` && pwd)
12+
ROOT_DIR="${DIR}/.."
13+
14+
echo "Docs will be available at http://localhost:8081/"
15+
16+
docker run -it --rm -p 8081:80 \
17+
-v "${ROOT_DIR}:/usr/share/nginx/html/swagger/" \
18+
-e SPEC_URL=swagger/openapi.yaml \
19+
-e REDOC_OPTIONS="required-props-first=1 path-in-middle-panel=1" \
20+
redocly/redoc

build

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ printf "\n"
1414

1515
bash "${DIR}/bin/php" ./bin/generate-oas.php
1616

17-
cp "${DIR}/examples/"*.cs "${DIR}/sandbox/dotnet/src/Dropbox.SignSandbox/"
18-
cp "${DIR}/examples/"*.java "${DIR}/sandbox/java/src/main/java/com/dropbox/sign_sandbox/"
19-
cp "${DIR}/examples/"*.php "${DIR}/sandbox/php/src/"
20-
cp "${DIR}/examples/"*.py "${DIR}/sandbox/python/src/"
21-
cp "${DIR}/examples/"*.rb "${DIR}/sandbox/ruby/src/"
22-
cp "${DIR}/examples/"*.ts "${DIR}/sandbox/node/src/"
17+
"${DIR}/bin/copy-examples-filtered" "${DIR}/examples" "${DIR}/sandbox/dotnet/src/Dropbox.SignSandbox" cs
18+
"${DIR}/bin/copy-examples-filtered" "${DIR}/examples" "${DIR}/sandbox/java/src/main/java/com/dropbox/sign_sandbox" java
19+
"${DIR}/bin/copy-examples-filtered" "${DIR}/examples" "${DIR}/sandbox/php/src" php
20+
"${DIR}/bin/copy-examples-filtered" "${DIR}/examples" "${DIR}/sandbox/python/src" py
21+
"${DIR}/bin/copy-examples-filtered" "${DIR}/examples" "${DIR}/sandbox/ruby/src" rb
22+
"${DIR}/bin/copy-examples-filtered" "${DIR}/examples" "${DIR}/sandbox/node/src" ts
2323

2424
printf "Success!\n"

copy-sdks

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,17 @@ function copy_files()
122122
cp -r "${DIR}/openapi-sdk.yaml" "${SDK_DIR}/openapi-sdk.yaml"
123123

124124
if [[ "${SDK}" == "dotnet" ]]; then
125-
cp -r "${DIR}/examples/"*.cs "${SDK_DIR}/examples/"
125+
"${DIR}/bin/copy-examples-filtered" "${DIR}/examples" "${SDK_DIR}/examples" cs
126126
elif [[ "${SDK}" == "java-v2" ]] || [[ "${SDK}" == "java-v1" ]]; then
127-
cp -r "${DIR}/examples/"*.java "${SDK_DIR}/examples/"
127+
"${DIR}/bin/copy-examples-filtered" "${DIR}/examples" "${SDK_DIR}/examples" java
128128
elif [[ "${SDK}" == "node" ]]; then
129-
cp -r "${DIR}/examples/"*.ts "${SDK_DIR}/examples/"
129+
"${DIR}/bin/copy-examples-filtered" "${DIR}/examples" "${SDK_DIR}/examples" ts
130130
elif [[ "${SDK}" == "php" ]]; then
131-
cp -r "${DIR}/examples/"*.php "${SDK_DIR}/examples/"
131+
"${DIR}/bin/copy-examples-filtered" "${DIR}/examples" "${SDK_DIR}/examples" php
132132
elif [[ "${SDK}" == "python" ]]; then
133-
cp -r "${DIR}/examples/"*.py "${SDK_DIR}/examples/"
133+
"${DIR}/bin/copy-examples-filtered" "${DIR}/examples" "${SDK_DIR}/examples" py
134134
elif [[ "${SDK}" == "ruby" ]]; then
135-
cp -r "${DIR}/examples/"*.rb "${SDK_DIR}/examples/"
135+
"${DIR}/bin/copy-examples-filtered" "${DIR}/examples" "${SDK_DIR}/examples" rb
136136
fi
137137

138138
php "${DIR}/bin/update-sdk-version.php" ${SDK} ${VERSION}

examples/SignatureRequestCreateEmbeddedExample.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ public static void Run()
2222
draw: true,
2323
phone: false,
2424
type: true,
25-
upload: true
25+
upload: true,
26+
force_advanced_signature_details: false
2627
);
2728

2829
var signers1 = new SubSignatureRequestSigner(

examples/SignatureRequestCreateEmbeddedExample.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public static void main(String[] args)
2929
signingOptions.phone(false);
3030
signingOptions.type(true);
3131
signingOptions.upload(true);
32+
signingOptions.forceAdvancedSignatureDetails(false);
3233

3334
var signers1 = new SubSignatureRequestSigner();
3435
signers1.name("Jack");

examples/SignatureRequestCreateEmbeddedExample.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
->setDraw(true)
1717
->setPhone(false)
1818
->setType(true)
19-
->setUpload(true);
19+
->setUpload(true)
20+
->setForceAdvancedSignatureDetails(false);
2021

2122
$signers_1 = (new Dropbox\Sign\Model\SubSignatureRequestSigner())
2223
->setName("Jack")

examples/SignatureRequestCreateEmbeddedExample.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
phone=False,
1717
type=True,
1818
upload=True,
19+
force_advanced_signature_details=False,
1920
)
2021

2122
signers_1 = models.SubSignatureRequestSigner(

examples/SignatureRequestCreateEmbeddedExample.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
signing_options.phone = false
1313
signing_options.type = true
1414
signing_options.upload = true
15+
signing_options.force_advanced_signature_details = false
1516

1617
signers_1 = Dropbox::Sign::SubSignatureRequestSigner.new
1718
signers_1.name = "Jack"

examples/SignatureRequestCreateEmbeddedExample.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ curl -X POST 'https://api.hellosign.com/v3/signature_request/create_embedded' \
1818
-F 'signing_options[upload]=1' \
1919
-F 'signing_options[phone]=1' \
2020
-F 'signing_options[default_type]=draw' \
21+
-F 'signing_options[force_advanced_signature_details]=0' \
2122
-F 'test_mode=1'

0 commit comments

Comments
 (0)