postgrid-node 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +84 -0
- package/LICENSE +1 -1
- package/README.md +13 -10
- package/client.d.mts +30 -10
- package/client.d.mts.map +1 -1
- package/client.d.ts +30 -10
- package/client.d.ts.map +1 -1
- package/client.js +56 -10
- package/client.js.map +1 -1
- package/client.mjs +57 -11
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/types.d.mts +6 -6
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +6 -6
- package/internal/types.d.ts.map +1 -1
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +3 -2
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +3 -2
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/query.d.mts +5 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +5 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +23 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +20 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +7 -1
- package/resources/address-verification.d.mts +1689 -15
- package/resources/address-verification.d.mts.map +1 -1
- package/resources/address-verification.d.ts +1689 -15
- package/resources/address-verification.d.ts.map +1 -1
- package/resources/address-verification.js +200 -0
- package/resources/address-verification.js.map +1 -1
- package/resources/address-verification.mjs +200 -0
- package/resources/address-verification.mjs.map +1 -1
- package/resources/index.d.mts +3 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/intl-address-verification.d.mts +956 -35
- package/resources/intl-address-verification.d.mts.map +1 -1
- package/resources/intl-address-verification.d.ts +956 -35
- package/resources/intl-address-verification.d.ts.map +1 -1
- package/resources/intl-address-verification.js +121 -27
- package/resources/intl-address-verification.js.map +1 -1
- package/resources/intl-address-verification.mjs +121 -27
- package/resources/intl-address-verification.mjs.map +1 -1
- package/resources/print-mail/boxes.d.mts +995 -0
- package/resources/print-mail/boxes.d.mts.map +1 -0
- package/resources/print-mail/boxes.d.ts +995 -0
- package/resources/print-mail/boxes.d.ts.map +1 -0
- package/resources/print-mail/boxes.js +103 -0
- package/resources/print-mail/boxes.js.map +1 -0
- package/resources/print-mail/boxes.mjs +99 -0
- package/resources/print-mail/boxes.mjs.map +1 -0
- package/resources/print-mail/campaigns.d.mts +923 -34
- package/resources/print-mail/campaigns.d.mts.map +1 -1
- package/resources/print-mail/campaigns.d.ts +923 -34
- package/resources/print-mail/campaigns.d.ts.map +1 -1
- package/resources/print-mail/campaigns.js +10 -3
- package/resources/print-mail/campaigns.js.map +1 -1
- package/resources/print-mail/campaigns.mjs +10 -3
- package/resources/print-mail/campaigns.mjs.map +1 -1
- package/resources/print-mail/cheques.d.mts +35 -5
- package/resources/print-mail/cheques.d.mts.map +1 -1
- package/resources/print-mail/cheques.d.ts +35 -5
- package/resources/print-mail/cheques.d.ts.map +1 -1
- package/resources/print-mail/cheques.js +32 -0
- package/resources/print-mail/cheques.js.map +1 -1
- package/resources/print-mail/cheques.mjs +32 -0
- package/resources/print-mail/cheques.mjs.map +1 -1
- package/resources/print-mail/contacts.d.mts +138 -3
- package/resources/print-mail/contacts.d.mts.map +1 -1
- package/resources/print-mail/contacts.d.ts +138 -3
- package/resources/print-mail/contacts.d.ts.map +1 -1
- package/resources/print-mail/contacts.js.map +1 -1
- package/resources/print-mail/contacts.mjs.map +1 -1
- package/resources/print-mail/index.d.mts +12 -7
- package/resources/print-mail/index.d.mts.map +1 -1
- package/resources/print-mail/index.d.ts +12 -7
- package/resources/print-mail/index.d.ts.map +1 -1
- package/resources/print-mail/index.js +15 -5
- package/resources/print-mail/index.js.map +1 -1
- package/resources/print-mail/index.mjs +6 -1
- package/resources/print-mail/index.mjs.map +1 -1
- package/resources/print-mail/letters.d.mts +36 -6
- package/resources/print-mail/letters.d.mts.map +1 -1
- package/resources/print-mail/letters.d.ts +36 -6
- package/resources/print-mail/letters.d.ts.map +1 -1
- package/resources/print-mail/letters.js +32 -0
- package/resources/print-mail/letters.js.map +1 -1
- package/resources/print-mail/letters.mjs +32 -0
- package/resources/print-mail/letters.mjs.map +1 -1
- package/resources/print-mail/mailing-list-imports.d.mts +5 -1
- package/resources/print-mail/mailing-list-imports.d.mts.map +1 -1
- package/resources/print-mail/mailing-list-imports.d.ts +5 -1
- package/resources/print-mail/mailing-list-imports.d.ts.map +1 -1
- package/resources/print-mail/mailing-list-imports.js +4 -0
- package/resources/print-mail/mailing-list-imports.js.map +1 -1
- package/resources/print-mail/mailing-list-imports.mjs +4 -0
- package/resources/print-mail/mailing-list-imports.mjs.map +1 -1
- package/resources/print-mail/mailing-lists.d.mts +5 -1
- package/resources/print-mail/mailing-lists.d.mts.map +1 -1
- package/resources/print-mail/mailing-lists.d.ts +5 -1
- package/resources/print-mail/mailing-lists.d.ts.map +1 -1
- package/resources/print-mail/mailing-lists.js +4 -0
- package/resources/print-mail/mailing-lists.js.map +1 -1
- package/resources/print-mail/mailing-lists.mjs +4 -0
- package/resources/print-mail/mailing-lists.mjs.map +1 -1
- package/resources/print-mail/postcards.d.mts +63 -13
- package/resources/print-mail/postcards.d.mts.map +1 -1
- package/resources/print-mail/postcards.d.ts +63 -13
- package/resources/print-mail/postcards.d.ts.map +1 -1
- package/resources/print-mail/postcards.js +33 -0
- package/resources/print-mail/postcards.js.map +1 -1
- package/resources/print-mail/postcards.mjs +33 -0
- package/resources/print-mail/postcards.mjs.map +1 -1
- package/resources/print-mail/print-mail.d.mts +42 -159
- package/resources/print-mail/print-mail.d.mts.map +1 -1
- package/resources/print-mail/print-mail.d.ts +42 -159
- package/resources/print-mail/print-mail.d.ts.map +1 -1
- package/resources/print-mail/print-mail.js +36 -16
- package/resources/print-mail/print-mail.js.map +1 -1
- package/resources/print-mail/print-mail.mjs +36 -16
- package/resources/print-mail/print-mail.mjs.map +1 -1
- package/resources/print-mail/reports/exports.d.mts +7 -0
- package/resources/print-mail/reports/exports.d.mts.map +1 -1
- package/resources/print-mail/reports/exports.d.ts +7 -0
- package/resources/print-mail/reports/exports.d.ts.map +1 -1
- package/resources/print-mail/reports/exports.js +7 -0
- package/resources/print-mail/reports/exports.js.map +1 -1
- package/resources/print-mail/reports/exports.mjs +7 -0
- package/resources/print-mail/reports/exports.mjs.map +1 -1
- package/resources/print-mail/reports/reports.d.mts +7 -0
- package/resources/print-mail/reports/reports.d.mts.map +1 -1
- package/resources/print-mail/reports/reports.d.ts +7 -0
- package/resources/print-mail/reports/reports.d.ts.map +1 -1
- package/resources/print-mail/reports/reports.js +7 -0
- package/resources/print-mail/reports/reports.js.map +1 -1
- package/resources/print-mail/reports/reports.mjs +7 -0
- package/resources/print-mail/reports/reports.mjs.map +1 -1
- package/resources/print-mail/reports/samples.d.mts +7 -0
- package/resources/print-mail/reports/samples.d.mts.map +1 -1
- package/resources/print-mail/reports/samples.d.ts +7 -0
- package/resources/print-mail/reports/samples.d.ts.map +1 -1
- package/resources/print-mail/reports/samples.js +7 -0
- package/resources/print-mail/reports/samples.js.map +1 -1
- package/resources/print-mail/reports/samples.mjs +7 -0
- package/resources/print-mail/reports/samples.mjs.map +1 -1
- package/resources/print-mail/self-mailers.d.mts +25 -12
- package/resources/print-mail/self-mailers.d.mts.map +1 -1
- package/resources/print-mail/self-mailers.d.ts +25 -12
- package/resources/print-mail/self-mailers.d.ts.map +1 -1
- package/resources/print-mail/self-mailers.js +17 -0
- package/resources/print-mail/self-mailers.js.map +1 -1
- package/resources/print-mail/self-mailers.mjs +17 -0
- package/resources/print-mail/self-mailers.mjs.map +1 -1
- package/resources/print-mail/snap-packs.d.mts +1060 -0
- package/resources/print-mail/snap-packs.d.mts.map +1 -0
- package/resources/print-mail/snap-packs.d.ts +1060 -0
- package/resources/print-mail/snap-packs.d.ts.map +1 -0
- package/resources/print-mail/snap-packs.js +117 -0
- package/resources/print-mail/snap-packs.js.map +1 -0
- package/resources/print-mail/snap-packs.mjs +113 -0
- package/resources/print-mail/snap-packs.mjs.map +1 -0
- package/resources/print-mail/sub-organizations.d.mts +29 -17
- package/resources/print-mail/sub-organizations.d.mts.map +1 -1
- package/resources/print-mail/sub-organizations.d.ts +29 -17
- package/resources/print-mail/sub-organizations.d.ts.map +1 -1
- package/resources/print-mail/sub-organizations.js +26 -14
- package/resources/print-mail/sub-organizations.js.map +1 -1
- package/resources/print-mail/sub-organizations.mjs +26 -14
- package/resources/print-mail/sub-organizations.mjs.map +1 -1
- package/resources/print-mail/targeted-list-builds/filters.d.mts +92 -0
- package/resources/print-mail/targeted-list-builds/filters.d.mts.map +1 -0
- package/resources/print-mail/targeted-list-builds/filters.d.ts +92 -0
- package/resources/print-mail/targeted-list-builds/filters.d.ts.map +1 -0
- package/resources/print-mail/targeted-list-builds/filters.js +60 -0
- package/resources/print-mail/targeted-list-builds/filters.js.map +1 -0
- package/resources/print-mail/targeted-list-builds/filters.mjs +56 -0
- package/resources/print-mail/targeted-list-builds/filters.mjs.map +1 -0
- package/resources/print-mail/targeted-list-builds/index.d.mts +3 -0
- package/resources/print-mail/targeted-list-builds/index.d.mts.map +1 -0
- package/resources/print-mail/targeted-list-builds/index.d.ts +3 -0
- package/resources/print-mail/targeted-list-builds/index.d.ts.map +1 -0
- package/resources/print-mail/targeted-list-builds/index.js +9 -0
- package/resources/print-mail/targeted-list-builds/index.js.map +1 -0
- package/resources/print-mail/targeted-list-builds/index.mjs +4 -0
- package/resources/print-mail/targeted-list-builds/index.mjs.map +1 -0
- package/resources/print-mail/targeted-list-builds/targeted-list-builds.d.mts +1633 -0
- package/resources/print-mail/targeted-list-builds/targeted-list-builds.d.mts.map +1 -0
- package/resources/print-mail/targeted-list-builds/targeted-list-builds.d.ts +1633 -0
- package/resources/print-mail/targeted-list-builds/targeted-list-builds.d.ts.map +1 -0
- package/resources/print-mail/targeted-list-builds/targeted-list-builds.js +154 -0
- package/resources/print-mail/targeted-list-builds/targeted-list-builds.js.map +1 -0
- package/resources/print-mail/targeted-list-builds/targeted-list-builds.mjs +149 -0
- package/resources/print-mail/targeted-list-builds/targeted-list-builds.mjs.map +1 -0
- package/resources/print-mail/targeted-list-builds.d.mts +2 -0
- package/resources/print-mail/targeted-list-builds.d.mts.map +1 -0
- package/resources/print-mail/targeted-list-builds.d.ts +2 -0
- package/resources/print-mail/targeted-list-builds.d.ts.map +1 -0
- package/resources/print-mail/targeted-list-builds.js +6 -0
- package/resources/print-mail/targeted-list-builds.js.map +1 -0
- package/resources/print-mail/targeted-list-builds.mjs +3 -0
- package/resources/print-mail/targeted-list-builds.mjs.map +1 -0
- package/resources/print-mail/template-editor-sessions.d.mts +355 -0
- package/resources/print-mail/template-editor-sessions.d.mts.map +1 -0
- package/resources/print-mail/template-editor-sessions.d.ts +355 -0
- package/resources/print-mail/template-editor-sessions.d.ts.map +1 -0
- package/resources/print-mail/template-editor-sessions.js +78 -0
- package/resources/print-mail/template-editor-sessions.js.map +1 -0
- package/resources/print-mail/template-editor-sessions.mjs +74 -0
- package/resources/print-mail/template-editor-sessions.mjs.map +1 -0
- package/resources/print-mail/trackers.d.mts +409 -0
- package/resources/print-mail/trackers.d.mts.map +1 -0
- package/resources/print-mail/trackers.d.ts +409 -0
- package/resources/print-mail/trackers.d.ts.map +1 -0
- package/resources/print-mail/trackers.js +116 -0
- package/resources/print-mail/trackers.js.map +1 -0
- package/resources/print-mail/trackers.mjs +112 -0
- package/resources/print-mail/trackers.mjs.map +1 -0
- package/resources/print-mail/virtual-mailboxes/index.d.mts +3 -0
- package/resources/print-mail/virtual-mailboxes/index.d.mts.map +1 -0
- package/resources/print-mail/virtual-mailboxes/index.d.ts +3 -0
- package/resources/print-mail/virtual-mailboxes/index.d.ts.map +1 -0
- package/resources/print-mail/virtual-mailboxes/index.js +9 -0
- package/resources/print-mail/virtual-mailboxes/index.js.map +1 -0
- package/resources/print-mail/virtual-mailboxes/index.mjs +4 -0
- package/resources/print-mail/virtual-mailboxes/index.mjs.map +1 -0
- package/resources/print-mail/virtual-mailboxes/items.d.mts +235 -0
- package/resources/print-mail/virtual-mailboxes/items.d.mts.map +1 -0
- package/resources/print-mail/virtual-mailboxes/items.d.ts +235 -0
- package/resources/print-mail/virtual-mailboxes/items.d.ts.map +1 -0
- package/resources/print-mail/virtual-mailboxes/items.js +69 -0
- package/resources/print-mail/virtual-mailboxes/items.js.map +1 -0
- package/resources/print-mail/virtual-mailboxes/items.mjs +65 -0
- package/resources/print-mail/virtual-mailboxes/items.mjs.map +1 -0
- package/resources/print-mail/virtual-mailboxes/virtual-mailboxes.d.mts +334 -0
- package/resources/print-mail/virtual-mailboxes/virtual-mailboxes.d.mts.map +1 -0
- package/resources/print-mail/virtual-mailboxes/virtual-mailboxes.d.ts +334 -0
- package/resources/print-mail/virtual-mailboxes/virtual-mailboxes.d.ts.map +1 -0
- package/resources/print-mail/virtual-mailboxes/virtual-mailboxes.js +92 -0
- package/resources/print-mail/virtual-mailboxes/virtual-mailboxes.js.map +1 -0
- package/resources/print-mail/virtual-mailboxes/virtual-mailboxes.mjs +87 -0
- package/resources/print-mail/virtual-mailboxes/virtual-mailboxes.mjs.map +1 -0
- package/resources/print-mail/virtual-mailboxes.d.mts +2 -0
- package/resources/print-mail/virtual-mailboxes.d.mts.map +1 -0
- package/resources/print-mail/virtual-mailboxes.d.ts +2 -0
- package/resources/print-mail/virtual-mailboxes.d.ts.map +1 -0
- package/resources/print-mail/{order-profiles.js → virtual-mailboxes.js} +2 -2
- package/resources/print-mail/virtual-mailboxes.js.map +1 -0
- package/resources/print-mail/virtual-mailboxes.mjs +3 -0
- package/resources/print-mail/virtual-mailboxes.mjs.map +1 -0
- package/src/client.ts +116 -26
- package/src/internal/parse.ts +6 -0
- package/src/internal/types.ts +6 -8
- package/src/internal/utils/env.ts +2 -2
- package/src/internal/utils/log.ts +2 -1
- package/src/internal/utils/query.ts +23 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/address-verification.ts +2190 -24
- package/src/resources/index.ts +24 -5
- package/src/resources/intl-address-verification.ts +1219 -43
- package/src/resources/print-mail/boxes.ts +1324 -0
- package/src/resources/print-mail/campaigns.ts +1449 -59
- package/src/resources/print-mail/cheques.ts +42 -4
- package/src/resources/print-mail/contacts.ts +167 -4
- package/src/resources/print-mail/index.ts +79 -4
- package/src/resources/print-mail/letters.ts +43 -5
- package/src/resources/print-mail/mailing-list-imports.ts +5 -1
- package/src/resources/print-mail/mailing-lists.ts +5 -1
- package/src/resources/print-mail/postcards.ts +74 -12
- package/src/resources/print-mail/print-mail.ts +245 -239
- package/src/resources/print-mail/reports/exports.ts +7 -0
- package/src/resources/print-mail/reports/reports.ts +7 -0
- package/src/resources/print-mail/reports/samples.ts +7 -0
- package/src/resources/print-mail/self-mailers.ts +28 -12
- package/src/resources/print-mail/snap-packs.ts +1484 -0
- package/src/resources/print-mail/sub-organizations.ts +35 -23
- package/src/resources/print-mail/targeted-list-builds/filters.ts +113 -0
- package/src/resources/print-mail/targeted-list-builds/index.ts +16 -0
- package/src/resources/print-mail/targeted-list-builds/targeted-list-builds.ts +2158 -0
- package/{resources/print-mail/order-profiles.mjs → src/resources/print-mail/targeted-list-builds.ts} +2 -2
- package/src/resources/print-mail/template-editor-sessions.ts +435 -0
- package/src/resources/print-mail/trackers.ts +513 -0
- package/src/resources/print-mail/virtual-mailboxes/index.ts +22 -0
- package/src/resources/print-mail/virtual-mailboxes/items.ts +296 -0
- package/src/resources/print-mail/virtual-mailboxes/virtual-mailboxes.ts +434 -0
- package/src/resources/print-mail/{order-profiles.ts → virtual-mailboxes.ts} +1 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/internal/qs/formats.d.mts +0 -7
- package/internal/qs/formats.d.mts.map +0 -1
- package/internal/qs/formats.d.ts +0 -7
- package/internal/qs/formats.d.ts.map +0 -1
- package/internal/qs/formats.js +0 -13
- package/internal/qs/formats.js.map +0 -1
- package/internal/qs/formats.mjs +0 -9
- package/internal/qs/formats.mjs.map +0 -1
- package/internal/qs/index.d.mts +0 -10
- package/internal/qs/index.d.mts.map +0 -1
- package/internal/qs/index.d.ts +0 -10
- package/internal/qs/index.d.ts.map +0 -1
- package/internal/qs/index.js +0 -14
- package/internal/qs/index.js.map +0 -1
- package/internal/qs/index.mjs +0 -10
- package/internal/qs/index.mjs.map +0 -1
- package/internal/qs/stringify.d.mts +0 -3
- package/internal/qs/stringify.d.mts.map +0 -1
- package/internal/qs/stringify.d.ts +0 -3
- package/internal/qs/stringify.d.ts.map +0 -1
- package/internal/qs/stringify.js +0 -277
- package/internal/qs/stringify.js.map +0 -1
- package/internal/qs/stringify.mjs +0 -274
- package/internal/qs/stringify.mjs.map +0 -1
- package/internal/qs/types.d.mts +0 -57
- package/internal/qs/types.d.mts.map +0 -1
- package/internal/qs/types.d.ts +0 -57
- package/internal/qs/types.d.ts.map +0 -1
- package/internal/qs/types.js +0 -3
- package/internal/qs/types.js.map +0 -1
- package/internal/qs/types.mjs +0 -2
- package/internal/qs/types.mjs.map +0 -1
- package/internal/qs/utils.d.mts +0 -15
- package/internal/qs/utils.d.mts.map +0 -1
- package/internal/qs/utils.d.ts +0 -15
- package/internal/qs/utils.d.ts.map +0 -1
- package/internal/qs/utils.js +0 -230
- package/internal/qs/utils.js.map +0 -1
- package/internal/qs/utils.mjs +0 -217
- package/internal/qs/utils.mjs.map +0 -1
- package/resources/print-mail/order-profiles/cheques.d.mts +0 -387
- package/resources/print-mail/order-profiles/cheques.d.mts.map +0 -1
- package/resources/print-mail/order-profiles/cheques.d.ts +0 -387
- package/resources/print-mail/order-profiles/cheques.d.ts.map +0 -1
- package/resources/print-mail/order-profiles/cheques.js +0 -98
- package/resources/print-mail/order-profiles/cheques.js.map +0 -1
- package/resources/print-mail/order-profiles/cheques.mjs +0 -94
- package/resources/print-mail/order-profiles/cheques.mjs.map +0 -1
- package/resources/print-mail/order-profiles/index.d.mts +0 -6
- package/resources/print-mail/order-profiles/index.d.mts.map +0 -1
- package/resources/print-mail/order-profiles/index.d.ts +0 -6
- package/resources/print-mail/order-profiles/index.d.ts.map +0 -1
- package/resources/print-mail/order-profiles/index.js +0 -15
- package/resources/print-mail/order-profiles/index.js.map +0 -1
- package/resources/print-mail/order-profiles/index.mjs +0 -7
- package/resources/print-mail/order-profiles/index.mjs.map +0 -1
- package/resources/print-mail/order-profiles/letters.d.mts +0 -324
- package/resources/print-mail/order-profiles/letters.d.mts.map +0 -1
- package/resources/print-mail/order-profiles/letters.d.ts +0 -324
- package/resources/print-mail/order-profiles/letters.d.ts.map +0 -1
- package/resources/print-mail/order-profiles/letters.js +0 -105
- package/resources/print-mail/order-profiles/letters.js.map +0 -1
- package/resources/print-mail/order-profiles/letters.mjs +0 -101
- package/resources/print-mail/order-profiles/letters.mjs.map +0 -1
- package/resources/print-mail/order-profiles/order-profiles.d.mts +0 -22
- package/resources/print-mail/order-profiles/order-profiles.d.mts.map +0 -1
- package/resources/print-mail/order-profiles/order-profiles.d.ts +0 -22
- package/resources/print-mail/order-profiles/order-profiles.d.ts.map +0 -1
- package/resources/print-mail/order-profiles/order-profiles.js +0 -29
- package/resources/print-mail/order-profiles/order-profiles.js.map +0 -1
- package/resources/print-mail/order-profiles/order-profiles.mjs +0 -24
- package/resources/print-mail/order-profiles/order-profiles.mjs.map +0 -1
- package/resources/print-mail/order-profiles/postcards.d.mts +0 -254
- package/resources/print-mail/order-profiles/postcards.d.mts.map +0 -1
- package/resources/print-mail/order-profiles/postcards.d.ts +0 -254
- package/resources/print-mail/order-profiles/postcards.d.ts.map +0 -1
- package/resources/print-mail/order-profiles/postcards.js +0 -97
- package/resources/print-mail/order-profiles/postcards.js.map +0 -1
- package/resources/print-mail/order-profiles/postcards.mjs +0 -93
- package/resources/print-mail/order-profiles/postcards.mjs.map +0 -1
- package/resources/print-mail/order-profiles/self-mailers.d.mts +0 -259
- package/resources/print-mail/order-profiles/self-mailers.d.mts.map +0 -1
- package/resources/print-mail/order-profiles/self-mailers.d.ts +0 -259
- package/resources/print-mail/order-profiles/self-mailers.d.ts.map +0 -1
- package/resources/print-mail/order-profiles/self-mailers.js +0 -95
- package/resources/print-mail/order-profiles/self-mailers.js.map +0 -1
- package/resources/print-mail/order-profiles/self-mailers.mjs +0 -91
- package/resources/print-mail/order-profiles/self-mailers.mjs.map +0 -1
- package/resources/print-mail/order-profiles.d.mts +0 -2
- package/resources/print-mail/order-profiles.d.mts.map +0 -1
- package/resources/print-mail/order-profiles.d.ts +0 -2
- package/resources/print-mail/order-profiles.d.ts.map +0 -1
- package/resources/print-mail/order-profiles.js.map +0 -1
- package/resources/print-mail/order-profiles.mjs.map +0 -1
- package/src/internal/qs/LICENSE.md +0 -13
- package/src/internal/qs/README.md +0 -3
- package/src/internal/qs/formats.ts +0 -10
- package/src/internal/qs/index.ts +0 -13
- package/src/internal/qs/stringify.ts +0 -385
- package/src/internal/qs/types.ts +0 -71
- package/src/internal/qs/utils.ts +0 -265
- package/src/resources/print-mail/order-profiles/cheques.ts +0 -589
- package/src/resources/print-mail/order-profiles/index.ts +0 -47
- package/src/resources/print-mail/order-profiles/letters.ts +0 -489
- package/src/resources/print-mail/order-profiles/order-profiles.ts +0 -113
- package/src/resources/print-mail/order-profiles/postcards.ts +0 -404
- package/src/resources/print-mail/order-profiles/self-mailers.ts +0 -415
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.VirtualMailboxes = void 0;
|
|
5
|
+
const tslib_1 = require("../../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../../core/resource.js");
|
|
7
|
+
const ItemsAPI = tslib_1.__importStar(require("./items.js"));
|
|
8
|
+
const items_1 = require("./items.js");
|
|
9
|
+
const pagination_1 = require("../../../core/pagination.js");
|
|
10
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
11
|
+
/**
|
|
12
|
+
* Virtual mailboxes let you receive, scan, and forward your physical mail
|
|
13
|
+
* without needing a traditional physical mailbox. Each mailbox is fully
|
|
14
|
+
* digital, giving you a unique ID, status, and a set of capabilities such as
|
|
15
|
+
* forwarding mail to another address or viewing envelope scans. This allows you
|
|
16
|
+
* to manage physical correspondence entirely online.
|
|
17
|
+
*
|
|
18
|
+
* You can request access to this feature by reaching out to
|
|
19
|
+
* support@postgrid.com
|
|
20
|
+
*/
|
|
21
|
+
class VirtualMailboxes extends resource_1.APIResource {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.items = new ItemsAPI.Items(this._client);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Creates a new virtual mailbox. In live mode, the virtual mailbox will be pending
|
|
28
|
+
* assignment and cannot be used until it has been assigned and activated by our
|
|
29
|
+
* team. You will be notified via email once the virtual mailbox has been
|
|
30
|
+
* activated. In test mode, the virtual mailbox will be activated immediately upon
|
|
31
|
+
* creation.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const virtualMailbox =
|
|
36
|
+
* await client.printMail.virtualMailboxes.create({
|
|
37
|
+
* countryCode: 'US',
|
|
38
|
+
* capabilities: {
|
|
39
|
+
* envelopeScans: true,
|
|
40
|
+
* forwardMailTo: 'contact_pxd7wnnD1xY6H6etKNvjb4',
|
|
41
|
+
* },
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
create(body, options) {
|
|
46
|
+
return this._client.post('/print-mail/v1/virtual_mailboxes', { body, ...options });
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Retrieve Virtual Mailbox
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const virtualMailbox =
|
|
54
|
+
* await client.printMail.virtualMailboxes.retrieve('id');
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
retrieve(id, options) {
|
|
58
|
+
return this._client.get((0, path_1.path) `/print-mail/v1/virtual_mailboxes/${id}`, options);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Lists virtual mailboxes. You can use the `skip`, `limit`, and `search` query
|
|
62
|
+
* parameters to refine the list.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* // Automatically fetches more pages as needed.
|
|
67
|
+
* for await (const virtualMailboxListResponse of client.printMail.virtualMailboxes.list()) {
|
|
68
|
+
* // ...
|
|
69
|
+
* }
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
list(query = {}, options) {
|
|
73
|
+
return this._client.getAPIList('/print-mail/v1/virtual_mailboxes', (pagination_1.SkipLimit), { query, ...options });
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Retrieves the physical address of the virtual mailbox.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* const response =
|
|
81
|
+
* await client.printMail.virtualMailboxes.retrieveAddress(
|
|
82
|
+
* 'id',
|
|
83
|
+
* );
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
retrieveAddress(id, options) {
|
|
87
|
+
return this._client.get((0, path_1.path) `/print-mail/v1/virtual_mailboxes/${id}/address`, options);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.VirtualMailboxes = VirtualMailboxes;
|
|
91
|
+
VirtualMailboxes.Items = items_1.Items;
|
|
92
|
+
//# sourceMappingURL=virtual-mailboxes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-mailboxes.js","sourceRoot":"","sources":["../../../src/resources/print-mail/virtual-mailboxes/virtual-mailboxes.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AAErD,6DAAoC;AACpC,sCASiB;AAEjB,4DAAwF;AAExF,0DAAoD;AAEpD;;;;;;;;;GASG;AACH,MAAa,gBAAiB,SAAQ,sBAAW;IAAjD;;QACE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA8E3D,CAAC;IA5EC;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CACJ,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kCAAkC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oCAAoC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACjF,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CACF,QAAqD,EAAE,EACvD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,kCAAkC,EAClC,CAAA,sBAAqC,CAAA,EACrC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;OAUG;IACH,eAAe,CAAC,EAAU,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oCAAoC,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IACzF,CAAC;CACF;AA/ED,4CA+EC;AA6SD,gBAAgB,CAAC,KAAK,GAAG,aAAK,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import * as ItemsAPI from "./items.mjs";
|
|
4
|
+
import { Items, } from "./items.mjs";
|
|
5
|
+
import { SkipLimit } from "../../../core/pagination.mjs";
|
|
6
|
+
import { path } from "../../../internal/utils/path.mjs";
|
|
7
|
+
/**
|
|
8
|
+
* Virtual mailboxes let you receive, scan, and forward your physical mail
|
|
9
|
+
* without needing a traditional physical mailbox. Each mailbox is fully
|
|
10
|
+
* digital, giving you a unique ID, status, and a set of capabilities such as
|
|
11
|
+
* forwarding mail to another address or viewing envelope scans. This allows you
|
|
12
|
+
* to manage physical correspondence entirely online.
|
|
13
|
+
*
|
|
14
|
+
* You can request access to this feature by reaching out to
|
|
15
|
+
* support@postgrid.com
|
|
16
|
+
*/
|
|
17
|
+
export class VirtualMailboxes extends APIResource {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.items = new ItemsAPI.Items(this._client);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates a new virtual mailbox. In live mode, the virtual mailbox will be pending
|
|
24
|
+
* assignment and cannot be used until it has been assigned and activated by our
|
|
25
|
+
* team. You will be notified via email once the virtual mailbox has been
|
|
26
|
+
* activated. In test mode, the virtual mailbox will be activated immediately upon
|
|
27
|
+
* creation.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const virtualMailbox =
|
|
32
|
+
* await client.printMail.virtualMailboxes.create({
|
|
33
|
+
* countryCode: 'US',
|
|
34
|
+
* capabilities: {
|
|
35
|
+
* envelopeScans: true,
|
|
36
|
+
* forwardMailTo: 'contact_pxd7wnnD1xY6H6etKNvjb4',
|
|
37
|
+
* },
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
create(body, options) {
|
|
42
|
+
return this._client.post('/print-mail/v1/virtual_mailboxes', { body, ...options });
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Retrieve Virtual Mailbox
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const virtualMailbox =
|
|
50
|
+
* await client.printMail.virtualMailboxes.retrieve('id');
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
retrieve(id, options) {
|
|
54
|
+
return this._client.get(path `/print-mail/v1/virtual_mailboxes/${id}`, options);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Lists virtual mailboxes. You can use the `skip`, `limit`, and `search` query
|
|
58
|
+
* parameters to refine the list.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* // Automatically fetches more pages as needed.
|
|
63
|
+
* for await (const virtualMailboxListResponse of client.printMail.virtualMailboxes.list()) {
|
|
64
|
+
* // ...
|
|
65
|
+
* }
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
list(query = {}, options) {
|
|
69
|
+
return this._client.getAPIList('/print-mail/v1/virtual_mailboxes', (SkipLimit), { query, ...options });
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Retrieves the physical address of the virtual mailbox.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* const response =
|
|
77
|
+
* await client.printMail.virtualMailboxes.retrieveAddress(
|
|
78
|
+
* 'id',
|
|
79
|
+
* );
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
retrieveAddress(id, options) {
|
|
83
|
+
return this._client.get(path `/print-mail/v1/virtual_mailboxes/${id}/address`, options);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
VirtualMailboxes.Items = Items;
|
|
87
|
+
//# sourceMappingURL=virtual-mailboxes.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-mailboxes.mjs","sourceRoot":"","sources":["../../../src/resources/print-mail/virtual-mailboxes/virtual-mailboxes.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,KAAK,QAAQ;OACb,EAQL,KAAK,GACN;OAEM,EAAe,SAAS,EAAwB;OAEhD,EAAE,IAAI,EAAE;AAEf;;;;;;;;;GASG;AACH,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAAjD;;QACE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA8E3D,CAAC;IA5EC;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CACJ,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kCAAkC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,oCAAoC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACjF,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CACF,QAAqD,EAAE,EACvD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,kCAAkC,EAClC,CAAA,SAAqC,CAAA,EACrC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;OAUG;IACH,eAAe,CAAC,EAAU,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,oCAAoC,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IACzF,CAAC;CACF;AA6SD,gBAAgB,CAAC,KAAK,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-mailboxes.d.mts","sourceRoot":"","sources":["../../src/resources/print-mail/virtual-mailboxes.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-mailboxes.d.ts","sourceRoot":"","sources":["../../src/resources/print-mail/virtual-mailboxes.ts"],"names":[],"mappings":""}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const tslib_1 = require("../../internal/tslib.js");
|
|
5
|
-
tslib_1.__exportStar(require("./
|
|
6
|
-
//# sourceMappingURL=
|
|
5
|
+
tslib_1.__exportStar(require("./virtual-mailboxes/index.js"), exports);
|
|
6
|
+
//# sourceMappingURL=virtual-mailboxes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-mailboxes.js","sourceRoot":"","sources":["../../src/resources/print-mail/virtual-mailboxes.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,uEAA0C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-mailboxes.mjs","sourceRoot":"","sources":["../../src/resources/print-mail/virtual-mailboxes.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
package/src/client.ts
CHANGED
|
@@ -11,7 +11,7 @@ import type { APIResponseProps } from './internal/parse';
|
|
|
11
11
|
import { getPlatformHeaders } from './internal/detect-platform';
|
|
12
12
|
import * as Shims from './internal/shims';
|
|
13
13
|
import * as Opts from './internal/request-options';
|
|
14
|
-
import
|
|
14
|
+
import { stringifyQuery } from './internal/utils/query';
|
|
15
15
|
import { VERSION } from './version';
|
|
16
16
|
import * as Errors from './core/error';
|
|
17
17
|
import * as Pagination from './core/pagination';
|
|
@@ -21,6 +21,21 @@ import * as API from './resources/index';
|
|
|
21
21
|
import { APIPromise } from './core/api-promise';
|
|
22
22
|
import {
|
|
23
23
|
AddressVerification,
|
|
24
|
+
AddressVerificationAutocompleteParams,
|
|
25
|
+
AddressVerificationAutocompleteResponse,
|
|
26
|
+
AddressVerificationBatchVerificationParams,
|
|
27
|
+
AddressVerificationBatchVerificationResponse,
|
|
28
|
+
AddressVerificationGetAutocompletePreviewsParams,
|
|
29
|
+
AddressVerificationGetAutocompletePreviewsResponse,
|
|
30
|
+
AddressVerificationGetLookupInfoResponse,
|
|
31
|
+
AddressVerificationLookupCityOrStateFromPostalOrZipCodeParams,
|
|
32
|
+
AddressVerificationLookupCityOrStateFromPostalOrZipCodeResponse,
|
|
33
|
+
AddressVerificationLookupZipCodeFromCityOrStateParams,
|
|
34
|
+
AddressVerificationLookupZipCodeFromCityOrStateResponse,
|
|
35
|
+
AddressVerificationParseAnAddressParams,
|
|
36
|
+
AddressVerificationParseAnAddressResponse,
|
|
37
|
+
AddressVerificationSuggestAddressesParams,
|
|
38
|
+
AddressVerificationSuggestAddressesResponse,
|
|
24
39
|
AddressVerificationVerifyParams,
|
|
25
40
|
AddressVerificationVerifyResponse,
|
|
26
41
|
Errors as AddressVerificationAPIErrors,
|
|
@@ -28,14 +43,18 @@ import {
|
|
|
28
43
|
} from './resources/address-verification';
|
|
29
44
|
import {
|
|
30
45
|
IntlAddressVerification,
|
|
46
|
+
IntlAddressVerificationAutocompleteParams,
|
|
47
|
+
IntlAddressVerificationAutocompleteResponse,
|
|
48
|
+
IntlAddressVerificationBatchVerificationParams,
|
|
49
|
+
IntlAddressVerificationBatchVerificationResponse,
|
|
50
|
+
IntlAddressVerificationGetAutocompleteAdvancedPreviewsParams,
|
|
51
|
+
IntlAddressVerificationGetAutocompleteAdvancedPreviewsResponse,
|
|
52
|
+
IntlAddressVerificationGetAutocompletePreviewsParams,
|
|
53
|
+
IntlAddressVerificationGetAutocompletePreviewsResponse,
|
|
31
54
|
IntlAddressVerificationVerifyParams,
|
|
32
55
|
IntlAddressVerificationVerifyResponse,
|
|
33
56
|
} from './resources/intl-address-verification';
|
|
34
|
-
import {
|
|
35
|
-
ContactCreateWithCompanyName,
|
|
36
|
-
ContactCreateWithFirstName,
|
|
37
|
-
PrintMail,
|
|
38
|
-
} from './resources/print-mail/print-mail';
|
|
57
|
+
import { PrintMail } from './resources/print-mail/print-mail';
|
|
39
58
|
import { type Fetch } from './internal/builtin-types';
|
|
40
59
|
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
|
|
41
60
|
import { FinalRequestOptions, RequestOptions } from './internal/request-options';
|
|
@@ -139,7 +158,7 @@ export class PostGrid {
|
|
|
139
158
|
baseURL: string;
|
|
140
159
|
maxRetries: number;
|
|
141
160
|
timeout: number;
|
|
142
|
-
logger: Logger
|
|
161
|
+
logger: Logger;
|
|
143
162
|
logLevel: LogLevel | undefined;
|
|
144
163
|
fetchOptions: MergedRequestInit | undefined;
|
|
145
164
|
|
|
@@ -189,6 +208,18 @@ export class PostGrid {
|
|
|
189
208
|
this.fetch = options.fetch ?? Shims.getDefaultFetch();
|
|
190
209
|
this.#encoder = Opts.FallbackEncoder;
|
|
191
210
|
|
|
211
|
+
const customHeadersEnv = readEnv('POSTGRID_CUSTOM_HEADERS');
|
|
212
|
+
if (customHeadersEnv) {
|
|
213
|
+
const parsed: Record<string, string> = {};
|
|
214
|
+
for (const line of customHeadersEnv.split('\n')) {
|
|
215
|
+
const colon = line.indexOf(':');
|
|
216
|
+
if (colon >= 0) {
|
|
217
|
+
parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim();
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
options.defaultHeaders = { ...parsed, ...options.defaultHeaders };
|
|
221
|
+
}
|
|
222
|
+
|
|
192
223
|
this._options = options;
|
|
193
224
|
|
|
194
225
|
this.addressVerificationAPIKey = addressVerificationAPIKey;
|
|
@@ -269,8 +300,11 @@ export class PostGrid {
|
|
|
269
300
|
return buildHeaders([{ 'X-API-Key': this.printMailAPIKey }]);
|
|
270
301
|
}
|
|
271
302
|
|
|
272
|
-
|
|
273
|
-
|
|
303
|
+
/**
|
|
304
|
+
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
305
|
+
*/
|
|
306
|
+
protected stringifyQuery(query: object | Record<string, unknown>): string {
|
|
307
|
+
return stringifyQuery(query);
|
|
274
308
|
}
|
|
275
309
|
|
|
276
310
|
private getUserAgent(): string {
|
|
@@ -302,12 +336,13 @@ export class PostGrid {
|
|
|
302
336
|
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
|
|
303
337
|
|
|
304
338
|
const defaultQuery = this.defaultQuery();
|
|
305
|
-
|
|
306
|
-
|
|
339
|
+
const pathQuery = Object.fromEntries(url.searchParams);
|
|
340
|
+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
|
|
341
|
+
query = { ...pathQuery, ...defaultQuery, ...query };
|
|
307
342
|
}
|
|
308
343
|
|
|
309
344
|
if (typeof query === 'object' && query && !Array.isArray(query)) {
|
|
310
|
-
url.search = this.stringifyQuery(query
|
|
345
|
+
url.search = this.stringifyQuery(query);
|
|
311
346
|
}
|
|
312
347
|
|
|
313
348
|
return url.toString();
|
|
@@ -503,7 +538,7 @@ export class PostGrid {
|
|
|
503
538
|
loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
|
|
504
539
|
|
|
505
540
|
const errText = await response.text().catch((err: any) => castToError(err).message);
|
|
506
|
-
const errJSON = safeJSON(errText);
|
|
541
|
+
const errJSON = safeJSON(errText) as any;
|
|
507
542
|
const errMessage = errJSON ? undefined : errText;
|
|
508
543
|
|
|
509
544
|
loggerFor(this).debug(
|
|
@@ -540,9 +575,14 @@ export class PostGrid {
|
|
|
540
575
|
getAPIList<Item, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(
|
|
541
576
|
path: string,
|
|
542
577
|
Page: new (...args: any[]) => PageClass,
|
|
543
|
-
opts?: RequestOptions
|
|
578
|
+
opts?: PromiseOrValue<RequestOptions>,
|
|
544
579
|
): Pagination.PagePromise<PageClass, Item> {
|
|
545
|
-
return this.requestAPIList(
|
|
580
|
+
return this.requestAPIList(
|
|
581
|
+
Page,
|
|
582
|
+
opts && 'then' in opts ?
|
|
583
|
+
opts.then((opts) => ({ method: 'get', path, ...opts }))
|
|
584
|
+
: { method: 'get', path, ...opts },
|
|
585
|
+
);
|
|
546
586
|
}
|
|
547
587
|
|
|
548
588
|
requestAPIList<
|
|
@@ -550,7 +590,7 @@ export class PostGrid {
|
|
|
550
590
|
PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>,
|
|
551
591
|
>(
|
|
552
592
|
Page: new (...args: ConstructorParameters<typeof Pagination.AbstractPage>) => PageClass,
|
|
553
|
-
options: FinalRequestOptions
|
|
593
|
+
options: PromiseOrValue<FinalRequestOptions>,
|
|
554
594
|
): Pagination.PagePromise<PageClass, Item> {
|
|
555
595
|
const request = this.makeRequest(options, null, undefined);
|
|
556
596
|
return new Pagination.PagePromise<PageClass, Item>(this as any as PostGrid, request, Page);
|
|
@@ -563,9 +603,10 @@ export class PostGrid {
|
|
|
563
603
|
controller: AbortController,
|
|
564
604
|
): Promise<Response> {
|
|
565
605
|
const { signal, method, ...options } = init || {};
|
|
566
|
-
|
|
606
|
+
const abort = this._makeAbort(controller);
|
|
607
|
+
if (signal) signal.addEventListener('abort', abort, { once: true });
|
|
567
608
|
|
|
568
|
-
const timeout = setTimeout(
|
|
609
|
+
const timeout = setTimeout(abort, ms);
|
|
569
610
|
|
|
570
611
|
const isReadableBody =
|
|
571
612
|
((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
|
|
@@ -642,9 +683,9 @@ export class PostGrid {
|
|
|
642
683
|
}
|
|
643
684
|
}
|
|
644
685
|
|
|
645
|
-
// If the API asks us to wait a certain amount of time
|
|
646
|
-
//
|
|
647
|
-
if (
|
|
686
|
+
// If the API asks us to wait a certain amount of time, just do what it
|
|
687
|
+
// says, but otherwise calculate a default
|
|
688
|
+
if (timeoutMillis === undefined) {
|
|
648
689
|
const maxRetries = options.maxRetries ?? this.maxRetries;
|
|
649
690
|
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
|
|
650
691
|
}
|
|
@@ -732,6 +773,12 @@ export class PostGrid {
|
|
|
732
773
|
return headers.values;
|
|
733
774
|
}
|
|
734
775
|
|
|
776
|
+
private _makeAbort(controller: AbortController) {
|
|
777
|
+
// note: we can't just inline this method inside `fetchWithTimeout()` because then the closure
|
|
778
|
+
// would capture all request options, and cause a memory leak.
|
|
779
|
+
return () => controller.abort();
|
|
780
|
+
}
|
|
781
|
+
|
|
735
782
|
private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
|
|
736
783
|
bodyHeaders: HeadersLike;
|
|
737
784
|
body: BodyInit | undefined;
|
|
@@ -764,6 +811,14 @@ export class PostGrid {
|
|
|
764
811
|
(Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
|
|
765
812
|
) {
|
|
766
813
|
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
|
|
814
|
+
} else if (
|
|
815
|
+
typeof body === 'object' &&
|
|
816
|
+
headers.values.get('content-type') === 'application/x-www-form-urlencoded'
|
|
817
|
+
) {
|
|
818
|
+
return {
|
|
819
|
+
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
820
|
+
body: this.stringifyQuery(body),
|
|
821
|
+
};
|
|
767
822
|
} else {
|
|
768
823
|
return this.#encoder({ body, headers });
|
|
769
824
|
}
|
|
@@ -788,7 +843,23 @@ export class PostGrid {
|
|
|
788
843
|
|
|
789
844
|
static toFile = Uploads.toFile;
|
|
790
845
|
|
|
846
|
+
/**
|
|
847
|
+
* Standard Address Verification API.
|
|
848
|
+
*
|
|
849
|
+
* Provides endpoints to verify and standardize addresses across US and Canada,
|
|
850
|
+
* supporting both structured and freeform inputs.
|
|
851
|
+
*
|
|
852
|
+
* Note that this uses a different set of lookups than our international API.
|
|
853
|
+
*
|
|
854
|
+
*/
|
|
791
855
|
addressVerification: API.AddressVerification = new API.AddressVerification(this);
|
|
856
|
+
/**
|
|
857
|
+
* International Address Verification API.
|
|
858
|
+
*
|
|
859
|
+
* Provides endpoints to verify and standardize international addresses,
|
|
860
|
+
* supporting both structured and freeform inputs.
|
|
861
|
+
*
|
|
862
|
+
*/
|
|
792
863
|
intlAddressVerification: API.IntlAddressVerification = new API.IntlAddressVerification(this);
|
|
793
864
|
printMail: API.PrintMail = new API.PrintMail(this);
|
|
794
865
|
}
|
|
@@ -807,19 +878,38 @@ export declare namespace PostGrid {
|
|
|
807
878
|
AddressVerification as AddressVerification,
|
|
808
879
|
type AddressVerificationAPIErrors as Errors,
|
|
809
880
|
type Status as Status,
|
|
881
|
+
type AddressVerificationAutocompleteResponse as AddressVerificationAutocompleteResponse,
|
|
882
|
+
type AddressVerificationBatchVerificationResponse as AddressVerificationBatchVerificationResponse,
|
|
883
|
+
type AddressVerificationGetAutocompletePreviewsResponse as AddressVerificationGetAutocompletePreviewsResponse,
|
|
884
|
+
type AddressVerificationGetLookupInfoResponse as AddressVerificationGetLookupInfoResponse,
|
|
885
|
+
type AddressVerificationLookupCityOrStateFromPostalOrZipCodeResponse as AddressVerificationLookupCityOrStateFromPostalOrZipCodeResponse,
|
|
886
|
+
type AddressVerificationLookupZipCodeFromCityOrStateResponse as AddressVerificationLookupZipCodeFromCityOrStateResponse,
|
|
887
|
+
type AddressVerificationParseAnAddressResponse as AddressVerificationParseAnAddressResponse,
|
|
888
|
+
type AddressVerificationSuggestAddressesResponse as AddressVerificationSuggestAddressesResponse,
|
|
810
889
|
type AddressVerificationVerifyResponse as AddressVerificationVerifyResponse,
|
|
890
|
+
type AddressVerificationAutocompleteParams as AddressVerificationAutocompleteParams,
|
|
891
|
+
type AddressVerificationBatchVerificationParams as AddressVerificationBatchVerificationParams,
|
|
892
|
+
type AddressVerificationGetAutocompletePreviewsParams as AddressVerificationGetAutocompletePreviewsParams,
|
|
893
|
+
type AddressVerificationLookupCityOrStateFromPostalOrZipCodeParams as AddressVerificationLookupCityOrStateFromPostalOrZipCodeParams,
|
|
894
|
+
type AddressVerificationLookupZipCodeFromCityOrStateParams as AddressVerificationLookupZipCodeFromCityOrStateParams,
|
|
895
|
+
type AddressVerificationParseAnAddressParams as AddressVerificationParseAnAddressParams,
|
|
896
|
+
type AddressVerificationSuggestAddressesParams as AddressVerificationSuggestAddressesParams,
|
|
811
897
|
type AddressVerificationVerifyParams as AddressVerificationVerifyParams,
|
|
812
898
|
};
|
|
813
899
|
|
|
814
900
|
export {
|
|
815
901
|
IntlAddressVerification as IntlAddressVerification,
|
|
902
|
+
type IntlAddressVerificationAutocompleteResponse as IntlAddressVerificationAutocompleteResponse,
|
|
903
|
+
type IntlAddressVerificationBatchVerificationResponse as IntlAddressVerificationBatchVerificationResponse,
|
|
904
|
+
type IntlAddressVerificationGetAutocompleteAdvancedPreviewsResponse as IntlAddressVerificationGetAutocompleteAdvancedPreviewsResponse,
|
|
905
|
+
type IntlAddressVerificationGetAutocompletePreviewsResponse as IntlAddressVerificationGetAutocompletePreviewsResponse,
|
|
816
906
|
type IntlAddressVerificationVerifyResponse as IntlAddressVerificationVerifyResponse,
|
|
907
|
+
type IntlAddressVerificationAutocompleteParams as IntlAddressVerificationAutocompleteParams,
|
|
908
|
+
type IntlAddressVerificationBatchVerificationParams as IntlAddressVerificationBatchVerificationParams,
|
|
909
|
+
type IntlAddressVerificationGetAutocompleteAdvancedPreviewsParams as IntlAddressVerificationGetAutocompleteAdvancedPreviewsParams,
|
|
910
|
+
type IntlAddressVerificationGetAutocompletePreviewsParams as IntlAddressVerificationGetAutocompletePreviewsParams,
|
|
817
911
|
type IntlAddressVerificationVerifyParams as IntlAddressVerificationVerifyParams,
|
|
818
912
|
};
|
|
819
913
|
|
|
820
|
-
export {
|
|
821
|
-
PrintMail as PrintMail,
|
|
822
|
-
type ContactCreateWithCompanyName as ContactCreateWithCompanyName,
|
|
823
|
-
type ContactCreateWithFirstName as ContactCreateWithFirstName,
|
|
824
|
-
};
|
|
914
|
+
export { PrintMail as PrintMail };
|
|
825
915
|
}
|
package/src/internal/parse.ts
CHANGED
|
@@ -29,6 +29,12 @@ export async function defaultParseResponse<T>(client: PostGrid, props: APIRespon
|
|
|
29
29
|
const mediaType = contentType?.split(';')[0]?.trim();
|
|
30
30
|
const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
|
|
31
31
|
if (isJSON) {
|
|
32
|
+
const contentLength = response.headers.get('content-length');
|
|
33
|
+
if (contentLength === '0') {
|
|
34
|
+
// if there is no content we can't do anything
|
|
35
|
+
return undefined as T;
|
|
36
|
+
}
|
|
37
|
+
|
|
32
38
|
const json = await response.json();
|
|
33
39
|
return json as T;
|
|
34
40
|
}
|
package/src/internal/types.ts
CHANGED
|
@@ -40,7 +40,6 @@ type OverloadedParameters<T> =
|
|
|
40
40
|
: T extends (...args: infer A) => unknown ? A
|
|
41
41
|
: never;
|
|
42
42
|
|
|
43
|
-
/* eslint-disable */
|
|
44
43
|
/**
|
|
45
44
|
* These imports attempt to get types from a parent package's dependencies.
|
|
46
45
|
* Unresolved bare specifiers can trigger [automatic type acquisition][1] in some projects, which
|
|
@@ -63,19 +62,18 @@ type OverloadedParameters<T> =
|
|
|
63
62
|
*
|
|
64
63
|
* [1]: https://www.typescriptlang.org/tsconfig/#typeAcquisition
|
|
65
64
|
*/
|
|
66
|
-
/** @ts-ignore For users with \@types/node */
|
|
65
|
+
/** @ts-ignore For users with \@types/node */ /* prettier-ignore */
|
|
67
66
|
type UndiciTypesRequestInit = NotAny<import('../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit>;
|
|
68
|
-
/** @ts-ignore For users with undici */
|
|
67
|
+
/** @ts-ignore For users with undici */ /* prettier-ignore */
|
|
69
68
|
type UndiciRequestInit = NotAny<import('../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici/index.d.ts').RequestInit>;
|
|
70
|
-
/** @ts-ignore For users with \@types/bun */
|
|
69
|
+
/** @ts-ignore For users with \@types/bun */ /* prettier-ignore */
|
|
71
70
|
type BunRequestInit = globalThis.FetchRequestInit;
|
|
72
|
-
/** @ts-ignore For users with node-fetch@2 */
|
|
71
|
+
/** @ts-ignore For users with node-fetch@2 */ /* prettier-ignore */
|
|
73
72
|
type NodeFetch2RequestInit = NotAny<import('../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit>;
|
|
74
|
-
/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */
|
|
73
|
+
/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */ /* prettier-ignore */
|
|
75
74
|
type NodeFetch3RequestInit = NotAny<import('../node_modules/node-fetch').RequestInit> | NotAny<import('../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/node-fetch').RequestInit>;
|
|
76
|
-
/** @ts-ignore For users who use Deno */
|
|
75
|
+
/** @ts-ignore For users who use Deno */ /* prettier-ignore */
|
|
77
76
|
type FetchRequestInit = NonNullable<OverloadedParameters<typeof fetch>[1]>;
|
|
78
|
-
/* eslint-enable */
|
|
79
77
|
|
|
80
78
|
type RequestInits =
|
|
81
79
|
| NotAny<UndiciTypesRequestInit>
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export const readEnv = (env: string): string | undefined => {
|
|
11
11
|
if (typeof (globalThis as any).process !== 'undefined') {
|
|
12
|
-
return (globalThis as any).process.env?.[env]?.trim()
|
|
12
|
+
return (globalThis as any).process.env?.[env]?.trim() || undefined;
|
|
13
13
|
}
|
|
14
14
|
if (typeof (globalThis as any).Deno !== 'undefined') {
|
|
15
|
-
return (globalThis as any).Deno.env?.get?.(env)?.trim();
|
|
15
|
+
return (globalThis as any).Deno.env?.get?.(env)?.trim() || undefined;
|
|
16
16
|
}
|
|
17
17
|
return undefined;
|
|
18
18
|
};
|
|
@@ -106,8 +106,9 @@ export const formatRequestDetails = (details: {
|
|
|
106
106
|
([name, value]) => [
|
|
107
107
|
name,
|
|
108
108
|
(
|
|
109
|
-
name.toLowerCase() === 'x-api-key' ||
|
|
110
109
|
name.toLowerCase() === 'authorization' ||
|
|
110
|
+
name.toLowerCase() === 'api-key' ||
|
|
111
|
+
name.toLowerCase() === 'x-api-key' ||
|
|
111
112
|
name.toLowerCase() === 'cookie' ||
|
|
112
113
|
name.toLowerCase() === 'set-cookie'
|
|
113
114
|
) ?
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { PostGridError } from '../../core/error';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
7
|
+
*/
|
|
8
|
+
export function stringifyQuery(query: object | Record<string, unknown>) {
|
|
9
|
+
return Object.entries(query)
|
|
10
|
+
.filter(([_, value]) => typeof value !== 'undefined')
|
|
11
|
+
.map(([key, value]) => {
|
|
12
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
13
|
+
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
14
|
+
}
|
|
15
|
+
if (value === null) {
|
|
16
|
+
return `${encodeURIComponent(key)}=`;
|
|
17
|
+
}
|
|
18
|
+
throw new PostGridError(
|
|
19
|
+
`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`,
|
|
20
|
+
);
|
|
21
|
+
})
|
|
22
|
+
.join('&');
|
|
23
|
+
}
|
package/src/internal/utils.ts
CHANGED