@izak0s/spacebring-api 2.0.0 → 3.0.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/dist/index.d.ts CHANGED
@@ -2463,6 +2463,26 @@ interface paths {
2463
2463
  patch?: never;
2464
2464
  trace?: never;
2465
2465
  };
2466
+ "/transactions/day_passes/v1/{id}": {
2467
+ parameters: {
2468
+ query?: never;
2469
+ header?: never;
2470
+ path?: never;
2471
+ cookie?: never;
2472
+ };
2473
+ /**
2474
+ * Retrieve a day pass transaction
2475
+ * @description Retrieve a day passes transaction. <h3>OAuth</h3>Required scopes: <code>transactions.readonly</code> or <code>transactions</code>
2476
+ */
2477
+ get: operations["getDayPassesTransaction"];
2478
+ put?: never;
2479
+ post?: never;
2480
+ delete?: never;
2481
+ options?: never;
2482
+ head?: never;
2483
+ patch?: never;
2484
+ trace?: never;
2485
+ };
2466
2486
  "/transactions/money/v1": {
2467
2487
  parameters: {
2468
2488
  query?: never;
@@ -8292,8 +8312,6 @@ interface components {
8292
8312
  /** @description Whether the admin can access support tools. */
8293
8313
  support: boolean;
8294
8314
  };
8295
- /** @description ISO timestamp or date when privacy consent was given. */
8296
- privacyConsentDate?: string;
8297
8315
  /**
8298
8316
  * @description Role of the user in the network.
8299
8317
  * @enum {string}
@@ -12804,6 +12822,265 @@ interface components {
12804
12822
  userRefOwner?: string;
12805
12823
  };
12806
12824
  };
12825
+ transactionDayPasses: {
12826
+ /** @description Total day pass amount (absolute sum of expiring and permanent). */
12827
+ amount: number;
12828
+ /** @description Per-bucket amounts for charge transactions. */
12829
+ amounts: {
12830
+ /** @description Amount deducted from this balance bucket. */
12831
+ amount: number;
12832
+ /**
12833
+ * Format: date-time
12834
+ * @description Expiration date for expiring balances.
12835
+ */
12836
+ expirationDate?: string;
12837
+ /**
12838
+ * Format: uuid
12839
+ * @description Subscription associated with expiring balances.
12840
+ */
12841
+ subscriptionRef?: string;
12842
+ /**
12843
+ * @description Balance bucket type.
12844
+ * @enum {string}
12845
+ */
12846
+ type: "expiring" | "permanent";
12847
+ }[];
12848
+ /**
12849
+ * @deprecated
12850
+ * @description Deprecated. Use product instead.
12851
+ */
12852
+ booking?: {
12853
+ /**
12854
+ * Format: uuid
12855
+ * @description Booking id.
12856
+ */
12857
+ id: string;
12858
+ /** @description Booked resource. */
12859
+ resource: {
12860
+ /**
12861
+ * Format: uuid
12862
+ * @description Resource id.
12863
+ */
12864
+ id: string;
12865
+ /** @description Resource title. */
12866
+ title: string;
12867
+ };
12868
+ };
12869
+ /**
12870
+ * @deprecated
12871
+ * @description Deprecated. Use customer instead.
12872
+ */
12873
+ company?: {
12874
+ /**
12875
+ * Format: date-time
12876
+ * @description ISO timestamp of company creation.
12877
+ */
12878
+ createDate: string;
12879
+ /**
12880
+ * Format: uuid
12881
+ * @description Company id.
12882
+ */
12883
+ id: string;
12884
+ /**
12885
+ * Format: uuid
12886
+ * @description Location id.
12887
+ */
12888
+ locationRef: string;
12889
+ /** @description Company logo. */
12890
+ logo?: {
12891
+ /** @description Storage key of the company logo. */
12892
+ key: string;
12893
+ /** @description Public URL of the company logo. */
12894
+ url: string;
12895
+ };
12896
+ /** @description Company metadata. */
12897
+ metadata?: {
12898
+ [key: string]: unknown;
12899
+ };
12900
+ /** @description Internal notes. */
12901
+ notes?: string;
12902
+ /** @description Public logo URL derived from the company website. */
12903
+ publicLogoUrl?: string;
12904
+ /**
12905
+ * Format: uuid
12906
+ * @description Primary subscription id.
12907
+ */
12908
+ subscriptionRef: string | null;
12909
+ /** @description Company name. */
12910
+ title: string;
12911
+ };
12912
+ /**
12913
+ * Format: uuid
12914
+ * @deprecated
12915
+ * @description Deprecated. Use customer instead.
12916
+ */
12917
+ companyRef?: string;
12918
+ /**
12919
+ * Format: date-time
12920
+ * @description ISO timestamp of when the transaction was created.
12921
+ */
12922
+ createDate: string;
12923
+ /** @description Customer associated with this transaction. */
12924
+ customer: {
12925
+ /**
12926
+ * Format: uuid
12927
+ * @description ID of the company or membership.
12928
+ */
12929
+ id: string;
12930
+ /** @description Company logo. */
12931
+ logo?: {
12932
+ key: string;
12933
+ url: string;
12934
+ };
12935
+ /** @description Company name. */
12936
+ title?: string;
12937
+ /**
12938
+ * @description Whether the customer is a company or a user.
12939
+ * @enum {string}
12940
+ */
12941
+ type: "company" | "user";
12942
+ /** @description User details for membership customers. */
12943
+ user?: {
12944
+ about?: string | null;
12945
+ email?: string | null;
12946
+ /** Format: uuid */
12947
+ id: string;
12948
+ name?: string | null;
12949
+ phoneNumber?: string | null;
12950
+ photoUrl?: string | null;
12951
+ surname?: string | null;
12952
+ };
12953
+ };
12954
+ /** @description Transaction description. */
12955
+ description?: string;
12956
+ /**
12957
+ * Format: uuid
12958
+ * @description Unique identifier of the transaction.
12959
+ */
12960
+ id: string;
12961
+ /**
12962
+ * Format: uuid
12963
+ * @description ID of the organization (location).
12964
+ */
12965
+ locationRef: string;
12966
+ /**
12967
+ * Format: uuid
12968
+ * @deprecated
12969
+ * @description Deprecated. Use customer instead.
12970
+ */
12971
+ membershipRef?: string;
12972
+ /**
12973
+ * Format: uuid
12974
+ * @deprecated
12975
+ * @description Deprecated. Use userCreator instead.
12976
+ */
12977
+ membershipRefCreator?: string;
12978
+ /**
12979
+ * Format: uuid
12980
+ * @description ID of the network.
12981
+ */
12982
+ networkRef: string;
12983
+ /** @description Product details. */
12984
+ product?: {
12985
+ /**
12986
+ * Format: uuid
12987
+ * @description ID of the associated booking.
12988
+ */
12989
+ bookingRef?: string;
12990
+ /** @description Display title of the product. */
12991
+ title: string;
12992
+ /**
12993
+ * @description Product type.
12994
+ * @enum {string}
12995
+ */
12996
+ type: "booking";
12997
+ };
12998
+ /**
12999
+ * @deprecated
13000
+ * @description Deprecated.
13001
+ */
13002
+ refund?: {
13003
+ /** @description Refunded expiring amount. */
13004
+ amount: number;
13005
+ /**
13006
+ * Format: date-time
13007
+ * @description Refund creation timestamp.
13008
+ */
13009
+ createDate: string;
13010
+ };
13011
+ /** @description Transaction status. */
13012
+ status: string;
13013
+ /**
13014
+ * @description Day pass transaction type.
13015
+ * @enum {string}
13016
+ */
13017
+ type: "adminAllocation" | "adminCharge" | "booking" | "expiration" | "purchaseAllocation" | "refund" | "subscriptionAllocation" | "subscriptionExpiration";
13018
+ /**
13019
+ * @deprecated
13020
+ * @description Deprecated. Use userOwner instead.
13021
+ */
13022
+ user?: {
13023
+ about?: string | null;
13024
+ email?: string | null;
13025
+ /** Format: uuid */
13026
+ id: string;
13027
+ name?: string | null;
13028
+ phoneNumber?: string | null;
13029
+ photoUrl?: string | null;
13030
+ surname?: string | null;
13031
+ };
13032
+ /** @description User who created the transaction. */
13033
+ userCreatedBy?: {
13034
+ about?: string | null;
13035
+ email?: string | null;
13036
+ /** Format: uuid */
13037
+ id: string;
13038
+ name?: string | null;
13039
+ phoneNumber?: string | null;
13040
+ photoUrl?: string | null;
13041
+ surname?: string | null;
13042
+ };
13043
+ /**
13044
+ * @deprecated
13045
+ * @description Deprecated. Use userCreatedBy instead.
13046
+ */
13047
+ userCreator?: {
13048
+ about?: string | null;
13049
+ email?: string | null;
13050
+ /** Format: uuid */
13051
+ id: string;
13052
+ name?: string | null;
13053
+ phoneNumber?: string | null;
13054
+ photoUrl?: string | null;
13055
+ surname?: string | null;
13056
+ };
13057
+ /**
13058
+ * @deprecated
13059
+ * @description Deprecated. Use customer.user instead.
13060
+ */
13061
+ userOwner?: {
13062
+ about?: string | null;
13063
+ email?: string | null;
13064
+ /** Format: uuid */
13065
+ id: string;
13066
+ name?: string | null;
13067
+ phoneNumber?: string | null;
13068
+ photoUrl?: string | null;
13069
+ surname?: string | null;
13070
+ };
13071
+ /**
13072
+ * Format: uuid
13073
+ * @deprecated
13074
+ * @description Deprecated. Use userCreatedBy instead.
13075
+ */
13076
+ userRefCreator?: string;
13077
+ /**
13078
+ * Format: uuid
13079
+ * @deprecated
13080
+ * @description Deprecated. Use customer.user instead.
13081
+ */
13082
+ userRefOwner?: string;
13083
+ };
12807
13084
  transaction: {
12808
13085
  amount?: number;
12809
13086
  booking?: {
@@ -12894,13 +13171,11 @@ interface components {
12894
13171
  user?: components["schemas"]["user"];
12895
13172
  };
12896
13173
  balance: {
12897
- application?: {
12898
- allocation?: number;
12899
- amount?: number;
12900
- crossLocationUsage?: number;
12901
- expirationDate?: components["schemas"]["dateSchema"];
12902
- subscriptionRef?: string;
12903
- };
13174
+ allocation?: number;
13175
+ amount?: number;
13176
+ crossLocationUsage?: number;
13177
+ expirationDate?: components["schemas"]["dateSchema"];
13178
+ subscriptionRef?: string;
12904
13179
  };
12905
13180
  contact: {
12906
13181
  /**
@@ -13621,7 +13896,7 @@ interface components {
13621
13896
  invoiceRef: string;
13622
13897
  /** @description Line items to credit. */
13623
13898
  lines: {
13624
- /** @description Amount to credit in major units. */
13899
+ /** @description Share of the invoice item pre-discount total to credit in major units; discounts are prorated and exclusive tax is added on top. */
13625
13900
  amount?: number;
13626
13901
  /**
13627
13902
  * Format: uuid
@@ -13689,7 +13964,7 @@ interface components {
13689
13964
  invoiceRef: string;
13690
13965
  /** @description Line items to credit. */
13691
13966
  lines: {
13692
- /** @description Amount to credit in major units. */
13967
+ /** @description Share of the invoice item pre-discount total to credit in major units; discounts are prorated and exclusive tax is added on top. */
13693
13968
  amount?: number;
13694
13969
  /**
13695
13970
  * Format: uuid
@@ -18875,6 +19150,10 @@ interface operations {
18875
19150
  getContracts: {
18876
19151
  parameters: {
18877
19152
  query?: {
19153
+ /** @description Filter contracts created on or after this date (ISO 8601). Use with createDate[lte] for a range. */
19154
+ "createDate[gte]"?: string;
19155
+ /** @description Filter contracts created on or before this date (ISO 8601). Use with createDate[gte] for a range. */
19156
+ "createDate[lte]"?: string;
18878
19157
  /** @description UUID of the customer (membership or company). Provide customerRef or locationRef; when set, returns only that customer's contracts. */
18879
19158
  customerRef?: string;
18880
19159
  /** @description Maximum number of contracts per page. Defaults to 25 when omitted or invalid; values above 100 are capped at 100. */
@@ -23114,6 +23393,43 @@ interface operations {
23114
23393
  };
23115
23394
  };
23116
23395
  };
23396
+ getDayPassesTransaction: {
23397
+ parameters: {
23398
+ query?: never;
23399
+ header?: {
23400
+ /** @description The id of the network. Required when using bearer token authentication */
23401
+ "spacebring-network-id"?: string;
23402
+ };
23403
+ path: {
23404
+ /** @description The id of the transaction */
23405
+ id: string;
23406
+ };
23407
+ cookie?: never;
23408
+ };
23409
+ requestBody?: never;
23410
+ responses: {
23411
+ /** @description OK */
23412
+ 200: {
23413
+ headers: {
23414
+ [name: string]: unknown;
23415
+ };
23416
+ content: {
23417
+ "application/json": {
23418
+ transaction?: components["schemas"]["transactionDayPasses"];
23419
+ };
23420
+ };
23421
+ };
23422
+ /** @description Bad Request */
23423
+ 400: {
23424
+ headers: {
23425
+ [name: string]: unknown;
23426
+ };
23427
+ content: {
23428
+ "application/json": components["schemas"]["responseError"];
23429
+ };
23430
+ };
23431
+ };
23432
+ };
23117
23433
  getMoneyTransactions: {
23118
23434
  parameters: {
23119
23435
  query: {
@@ -23957,7 +24273,7 @@ type Balance = NonNullable<components["schemas"]["balance"]>;
23957
24273
  /** A CreditTransaction entity as returned by the Spacebring API. */
23958
24274
  type CreditTransaction = NonNullable<components["schemas"]["transactionCreditsExpanded"]>;
23959
24275
  /** A DayPassTransaction entity as returned by the Spacebring API. */
23960
- type DayPassTransaction = NonNullable<operations["getDayPassesTransactions"]["responses"][200]["content"]["application/json"]["transactions"]>[number];
24276
+ type DayPassTransaction = NonNullable<components["schemas"]["transactionDayPasses"]>;
23961
24277
  /** A MoneyTransaction entity as returned by the Spacebring API. */
23962
24278
  type MoneyTransaction = NonNullable<components["schemas"]["transaction"]>;
23963
24279
  /** Query parameters for `sb.transactions.credits.list()`. */
@@ -24383,6 +24699,10 @@ type Contract = NonNullable<operations["getContract"]["responses"][200]["content
24383
24699
  type Template = NonNullable<operations["getTemplate"]["responses"][200]["content"]["application/json"]["template"]>;
24384
24700
  /** Query parameters for `sb.contracts.list()`. */
24385
24701
  interface GetContractsQuery {
24702
+ /** Filter contracts created on or after this date (ISO 8601). Use with createDate[lte] for a range. */
24703
+ "createDate[gte]"?: string;
24704
+ /** Filter contracts created on or before this date (ISO 8601). Use with createDate[gte] for a range. */
24705
+ "createDate[lte]"?: string;
24386
24706
  /** UUID of the customer (membership or company). Provide customerRef or locationRef; when set, returns only that customer's contracts. */
24387
24707
  customerRef?: string;
24388
24708
  /** Maximum number of contracts per page. Defaults to 25 when omitted or invalid; values above 100 are capped at 100. */
@@ -25080,6 +25400,7 @@ declare function createResources(client: Client<paths>, defaults: SpacebringDefa
25080
25400
  transactions: DayPassTransaction[];
25081
25401
  }>;
25082
25402
  iterate(query?: Omit<GetDayPassesTransactionsQuery, "nextPageToken">, options?: SpacebringRequestOptions): AsyncGenerator<DayPassTransaction, void, undefined>;
25403
+ get(id: string, options?: SpacebringRequestOptions): Promise<DayPassTransaction>;
25083
25404
  create(transaction: CreateDayPassesTransactionBody, options?: SpacebringRequestOptions): Promise<DayPassTransaction>;
25084
25405
  };
25085
25406
  money: {
package/dist/index.js CHANGED
@@ -2481,6 +2481,17 @@ function createTransactions(client, defaults) {
2481
2481
  "transactions"
2482
2482
  );
2483
2483
  },
2484
+ /**
2485
+ * Retrieve a day pass transaction
2486
+ *
2487
+ * Retrieve a day passes transaction.
2488
+ *
2489
+ * @param id The id of the transaction
2490
+ * @param options Request options (abort signal).
2491
+ */
2492
+ async get(id, options) {
2493
+ return unwrapProp(await client.GET("/transactions/day_passes/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "transaction", "GET /transactions/day_passes/v1/{id}");
2494
+ },
2484
2495
  /**
2485
2496
  * Create a day pass transaction
2486
2497
  *