@sendly/node 3.19.0 → 3.20.0

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/README.md CHANGED
@@ -621,14 +621,14 @@ const result = await client.enterprise.provision({
621
621
  name: 'Acme Insurance - Austin',
622
622
  sourceWorkspaceId: 'ws_verified',
623
623
  creditAmount: 5000,
624
- creditSourceWorkspaceId: 'ws_pool',
624
+ creditSourceWorkspaceId: 'SOURCE_WORKSPACE_ID',
625
625
  keyName: 'Production',
626
626
  keyType: 'live',
627
627
  generateOptInPage: true
628
628
  });
629
629
 
630
630
  console.log(result.workspace.id);
631
- console.log(result.apiKey?.rawKey); // shown once
631
+ console.log(result.key?.key); // shown once
632
632
  console.log(result.optInPage?.url); // hosted opt-in page
633
633
  ```
634
634
 
@@ -698,7 +698,7 @@ const key = await client.enterprise.workspaces.createKey('ws_xxx', {
698
698
  name: 'Production',
699
699
  type: 'live'
700
700
  });
701
- console.log(key.rawKey); // shown once
701
+ console.log(key.key); // shown once
702
702
 
703
703
  // Revoke a key
704
704
  await client.enterprise.workspaces.revokeKey('ws_xxx', 'key_abc');
package/dist/index.d.mts CHANGED
@@ -1614,11 +1614,12 @@ interface ProvisionWorkspaceResult {
1614
1614
  balance: number;
1615
1615
  transferred?: number;
1616
1616
  };
1617
- apiKey?: {
1617
+ key?: {
1618
1618
  id: string;
1619
1619
  name: string;
1620
- prefix: string;
1621
- key?: string;
1620
+ key: string;
1621
+ keyPrefix: string;
1622
+ type: string;
1622
1623
  };
1623
1624
  optInPage?: {
1624
1625
  url: string;
@@ -3511,6 +3512,19 @@ declare class SettingsSubResource {
3511
3512
  getAutoTopUp(): Promise<AutoTopUpSettings>;
3512
3513
  updateAutoTopUp(options: UpdateAutoTopUpOptions): Promise<AutoTopUpSettings>;
3513
3514
  }
3515
+ declare class CreditsSubResource {
3516
+ private readonly http;
3517
+ constructor(http: HttpClient);
3518
+ get(): Promise<{
3519
+ balance: number;
3520
+ lifetimeCredits: number;
3521
+ reservedBalance: number;
3522
+ }>;
3523
+ deposit(amount: number, description?: string): Promise<{
3524
+ balance: number;
3525
+ lifetimeCredits: number;
3526
+ }>;
3527
+ }
3514
3528
  declare class BillingSubResource {
3515
3529
  private readonly http;
3516
3530
  constructor(http: HttpClient);
@@ -3523,6 +3537,7 @@ declare class EnterpriseResource {
3523
3537
  readonly analytics: AnalyticsSubResource;
3524
3538
  readonly settings: SettingsSubResource;
3525
3539
  readonly billing: BillingSubResource;
3540
+ readonly credits: CreditsSubResource;
3526
3541
  constructor(http: HttpClient);
3527
3542
  getAccount(): Promise<EnterpriseAccount>;
3528
3543
  provision(options: ProvisionWorkspaceOptions): Promise<ProvisionWorkspaceResult>;
package/dist/index.d.ts CHANGED
@@ -1614,11 +1614,12 @@ interface ProvisionWorkspaceResult {
1614
1614
  balance: number;
1615
1615
  transferred?: number;
1616
1616
  };
1617
- apiKey?: {
1617
+ key?: {
1618
1618
  id: string;
1619
1619
  name: string;
1620
- prefix: string;
1621
- key?: string;
1620
+ key: string;
1621
+ keyPrefix: string;
1622
+ type: string;
1622
1623
  };
1623
1624
  optInPage?: {
1624
1625
  url: string;
@@ -3511,6 +3512,19 @@ declare class SettingsSubResource {
3511
3512
  getAutoTopUp(): Promise<AutoTopUpSettings>;
3512
3513
  updateAutoTopUp(options: UpdateAutoTopUpOptions): Promise<AutoTopUpSettings>;
3513
3514
  }
3515
+ declare class CreditsSubResource {
3516
+ private readonly http;
3517
+ constructor(http: HttpClient);
3518
+ get(): Promise<{
3519
+ balance: number;
3520
+ lifetimeCredits: number;
3521
+ reservedBalance: number;
3522
+ }>;
3523
+ deposit(amount: number, description?: string): Promise<{
3524
+ balance: number;
3525
+ lifetimeCredits: number;
3526
+ }>;
3527
+ }
3514
3528
  declare class BillingSubResource {
3515
3529
  private readonly http;
3516
3530
  constructor(http: HttpClient);
@@ -3523,6 +3537,7 @@ declare class EnterpriseResource {
3523
3537
  readonly analytics: AnalyticsSubResource;
3524
3538
  readonly settings: SettingsSubResource;
3525
3539
  readonly billing: BillingSubResource;
3540
+ readonly credits: CreditsSubResource;
3526
3541
  constructor(http: HttpClient);
3527
3542
  getAccount(): Promise<EnterpriseAccount>;
3528
3543
  provision(options: ProvisionWorkspaceOptions): Promise<ProvisionWorkspaceResult>;
package/dist/index.js CHANGED
@@ -3236,6 +3236,31 @@ var SettingsSubResource = class {
3236
3236
  return transformKeys(response);
3237
3237
  }
3238
3238
  };
3239
+ var CreditsSubResource = class {
3240
+ http;
3241
+ constructor(http) {
3242
+ this.http = http;
3243
+ }
3244
+ async get() {
3245
+ const response = await this.http.request({
3246
+ method: "GET",
3247
+ path: "/enterprise/credits"
3248
+ });
3249
+ return transformKeys(response);
3250
+ }
3251
+ async deposit(amount, description) {
3252
+ const body = { amount };
3253
+ if (description !== void 0) {
3254
+ body.description = description;
3255
+ }
3256
+ const response = await this.http.request({
3257
+ method: "POST",
3258
+ path: "/enterprise/credits/deposit",
3259
+ body
3260
+ });
3261
+ return transformKeys(response);
3262
+ }
3263
+ };
3239
3264
  var BillingSubResource = class {
3240
3265
  http;
3241
3266
  constructor(http) {
@@ -3261,6 +3286,7 @@ var EnterpriseResource = class {
3261
3286
  analytics;
3262
3287
  settings;
3263
3288
  billing;
3289
+ credits;
3264
3290
  constructor(http) {
3265
3291
  this.http = http;
3266
3292
  this.workspaces = new WorkspacesSubResource(http);
@@ -3268,6 +3294,7 @@ var EnterpriseResource = class {
3268
3294
  this.analytics = new AnalyticsSubResource(http);
3269
3295
  this.settings = new SettingsSubResource(http);
3270
3296
  this.billing = new BillingSubResource(http);
3297
+ this.credits = new CreditsSubResource(http);
3271
3298
  }
3272
3299
  async getAccount() {
3273
3300
  const response = await this.http.request({
package/dist/index.mjs CHANGED
@@ -3176,6 +3176,31 @@ var SettingsSubResource = class {
3176
3176
  return transformKeys(response);
3177
3177
  }
3178
3178
  };
3179
+ var CreditsSubResource = class {
3180
+ http;
3181
+ constructor(http) {
3182
+ this.http = http;
3183
+ }
3184
+ async get() {
3185
+ const response = await this.http.request({
3186
+ method: "GET",
3187
+ path: "/enterprise/credits"
3188
+ });
3189
+ return transformKeys(response);
3190
+ }
3191
+ async deposit(amount, description) {
3192
+ const body = { amount };
3193
+ if (description !== void 0) {
3194
+ body.description = description;
3195
+ }
3196
+ const response = await this.http.request({
3197
+ method: "POST",
3198
+ path: "/enterprise/credits/deposit",
3199
+ body
3200
+ });
3201
+ return transformKeys(response);
3202
+ }
3203
+ };
3179
3204
  var BillingSubResource = class {
3180
3205
  http;
3181
3206
  constructor(http) {
@@ -3201,6 +3226,7 @@ var EnterpriseResource = class {
3201
3226
  analytics;
3202
3227
  settings;
3203
3228
  billing;
3229
+ credits;
3204
3230
  constructor(http) {
3205
3231
  this.http = http;
3206
3232
  this.workspaces = new WorkspacesSubResource(http);
@@ -3208,6 +3234,7 @@ var EnterpriseResource = class {
3208
3234
  this.analytics = new AnalyticsSubResource(http);
3209
3235
  this.settings = new SettingsSubResource(http);
3210
3236
  this.billing = new BillingSubResource(http);
3237
+ this.credits = new CreditsSubResource(http);
3211
3238
  }
3212
3239
  async getAccount() {
3213
3240
  const response = await this.http.request({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendly/node",
3
- "version": "3.19.0",
3
+ "version": "3.20.0",
4
4
  "description": "Official Sendly Node.js SDK for SMS messaging",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",