@izak0s/spacebring-api 2.1.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.cts 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;
@@ -12802,6 +12822,265 @@ interface components {
12802
12822
  userRefOwner?: string;
12803
12823
  };
12804
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
+ };
12805
13084
  transaction: {
12806
13085
  amount?: number;
12807
13086
  booking?: {
@@ -12892,13 +13171,11 @@ interface components {
12892
13171
  user?: components["schemas"]["user"];
12893
13172
  };
12894
13173
  balance: {
12895
- application?: {
12896
- allocation?: number;
12897
- amount?: number;
12898
- crossLocationUsage?: number;
12899
- expirationDate?: components["schemas"]["dateSchema"];
12900
- subscriptionRef?: string;
12901
- };
13174
+ allocation?: number;
13175
+ amount?: number;
13176
+ crossLocationUsage?: number;
13177
+ expirationDate?: components["schemas"]["dateSchema"];
13178
+ subscriptionRef?: string;
12902
13179
  };
12903
13180
  contact: {
12904
13181
  /**
@@ -23116,6 +23393,43 @@ interface operations {
23116
23393
  };
23117
23394
  };
23118
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
+ };
23119
23433
  getMoneyTransactions: {
23120
23434
  parameters: {
23121
23435
  query: {
@@ -23959,7 +24273,7 @@ type Balance = NonNullable<components["schemas"]["balance"]>;
23959
24273
  /** A CreditTransaction entity as returned by the Spacebring API. */
23960
24274
  type CreditTransaction = NonNullable<components["schemas"]["transactionCreditsExpanded"]>;
23961
24275
  /** A DayPassTransaction entity as returned by the Spacebring API. */
23962
- type DayPassTransaction = NonNullable<operations["getDayPassesTransactions"]["responses"][200]["content"]["application/json"]["transactions"]>[number];
24276
+ type DayPassTransaction = NonNullable<components["schemas"]["transactionDayPasses"]>;
23963
24277
  /** A MoneyTransaction entity as returned by the Spacebring API. */
23964
24278
  type MoneyTransaction = NonNullable<components["schemas"]["transaction"]>;
23965
24279
  /** Query parameters for `sb.transactions.credits.list()`. */
@@ -25086,6 +25400,7 @@ declare function createResources(client: Client<paths>, defaults: SpacebringDefa
25086
25400
  transactions: DayPassTransaction[];
25087
25401
  }>;
25088
25402
  iterate(query?: Omit<GetDayPassesTransactionsQuery, "nextPageToken">, options?: SpacebringRequestOptions): AsyncGenerator<DayPassTransaction, void, undefined>;
25403
+ get(id: string, options?: SpacebringRequestOptions): Promise<DayPassTransaction>;
25089
25404
  create(transaction: CreateDayPassesTransactionBody, options?: SpacebringRequestOptions): Promise<DayPassTransaction>;
25090
25405
  };
25091
25406
  money: {