@openmeter/sdk 1.0.0-beta-57d3f3ffb1f9 → 1.0.0-beta-8a61dd435b87

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.
@@ -8889,7 +8889,11 @@ export interface components {
8889
8889
  message?: string;
8890
8890
  };
8891
8891
  /**
8892
- * @description A subject is a unique identifier for a user or entity.
8892
+ * @description A subject is a unique identifier for a usage attribution by its key.
8893
+ * Subjects only exist in the concept of metering.
8894
+ * Subjects are optional to create and work as an enrichment for the subject key like displayName, metadata, etc.
8895
+ * Subjects are useful when you are reporting usage events with your own database ID but want to enrich the subject with a human-readable name or metadata.
8896
+ * For most use cases, a subject is equivalent to a customer.
8893
8897
  * @example {
8894
8898
  * "id": "01G65Z755AFWAKHE12NY0CQ9FH",
8895
8899
  * "key": "customer-id",
@@ -8897,8 +8901,6 @@ export interface components {
8897
8901
  * "metadata": {
8898
8902
  * "hubspotId": "123456"
8899
8903
  * },
8900
- * "currentPeriodStart": "2023-01-01T00:00:00Z",
8901
- * "currentPeriodEnd": "2023-02-01T00:00:00Z",
8902
8904
  * "stripeCustomerId": "cus_JMOlctsKV8"
8903
8905
  * }
8904
8906
  */
@@ -8910,7 +8912,8 @@ export interface components {
8910
8912
  readonly id: string;
8911
8913
  /**
8912
8914
  * @description A unique, human-readable identifier for the subject.
8913
- * @example customer-id
8915
+ * This is typically a database ID or a customer key.
8916
+ * @example customer-db-id-123
8914
8917
  */
8915
8918
  key: string;
8916
8919
  /**
@@ -8918,25 +8921,34 @@ export interface components {
8918
8921
  * @example Customer Name
8919
8922
  */
8920
8923
  displayName?: string | null;
8921
- /** @example {
8924
+ /**
8925
+ * @description Metadata for the subject.
8926
+ * @example {
8922
8927
  * "hubspotId": "123456"
8923
- * } */
8928
+ * }
8929
+ */
8924
8930
  metadata?: {
8925
- [key: string]: unknown;
8931
+ [key: string]: string;
8926
8932
  } | null;
8927
8933
  /**
8928
8934
  * Format: date-time
8929
- * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.
8935
+ * @deprecated
8936
+ * @description The start of the current period for the subject.
8930
8937
  * @example 2023-01-01T00:00:00Z
8931
8938
  */
8932
8939
  currentPeriodStart?: Date;
8933
8940
  /**
8934
8941
  * Format: date-time
8935
- * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.
8942
+ * @deprecated
8943
+ * @description The end of the current period for the subject.
8936
8944
  * @example 2023-02-01T00:00:00Z
8937
8945
  */
8938
8946
  currentPeriodEnd?: Date;
8939
- /** @example cus_JMOlctsKV8 */
8947
+ /**
8948
+ * @deprecated
8949
+ * @description The Stripe customer ID for the subject.
8950
+ * @example cus_JMOlctsKV8
8951
+ */
8940
8952
  stripeCustomerId?: string | null;
8941
8953
  };
8942
8954
  /**
@@ -8947,15 +8959,14 @@ export interface components {
8947
8959
  * "metadata": {
8948
8960
  * "hubspotId": "123456"
8949
8961
  * },
8950
- * "currentPeriodStart": "2023-01-01T00:00:00Z",
8951
- * "currentPeriodEnd": "2023-02-01T00:00:00Z",
8952
8962
  * "stripeCustomerId": "cus_JMOlctsKV8"
8953
8963
  * }
8954
8964
  */
8955
8965
  SubjectUpsert: {
8956
8966
  /**
8957
8967
  * @description A unique, human-readable identifier for the subject.
8958
- * @example customer-id
8968
+ * This is typically a database ID or a customer key.
8969
+ * @example customer-db-id-123
8959
8970
  */
8960
8971
  key: string;
8961
8972
  /**
@@ -8963,25 +8974,34 @@ export interface components {
8963
8974
  * @example Customer Name
8964
8975
  */
8965
8976
  displayName?: string | null;
8966
- /** @example {
8977
+ /**
8978
+ * @description Metadata for the subject.
8979
+ * @example {
8967
8980
  * "hubspotId": "123456"
8968
- * } */
8981
+ * }
8982
+ */
8969
8983
  metadata?: {
8970
- [key: string]: unknown;
8984
+ [key: string]: string;
8971
8985
  } | null;
8972
8986
  /**
8973
8987
  * Format: date-time
8974
- * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.
8988
+ * @deprecated
8989
+ * @description The start of the current period for the subject.
8975
8990
  * @example 2023-01-01T00:00:00Z
8976
8991
  */
8977
8992
  currentPeriodStart?: Date;
8978
8993
  /**
8979
8994
  * Format: date-time
8980
- * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.
8995
+ * @deprecated
8996
+ * @description The end of the current period for the subject.
8981
8997
  * @example 2023-02-01T00:00:00Z
8982
8998
  */
8983
8999
  currentPeriodEnd?: Date;
8984
- /** @example cus_JMOlctsKV8 */
9000
+ /**
9001
+ * @deprecated
9002
+ * @description The Stripe customer ID for the subject.
9003
+ * @example cus_JMOlctsKV8
9004
+ */
8985
9005
  stripeCustomerId?: string | null;
8986
9006
  };
8987
9007
  /** @description Subscription is an exact subscription instance. */
@@ -21,7 +21,7 @@ export declare class Subjects {
21
21
  key: string;
22
22
  displayName?: string | null;
23
23
  metadata?: {
24
- [key: string]: unknown;
24
+ [key: string]: string;
25
25
  } | null;
26
26
  currentPeriodStart?: Date;
27
27
  currentPeriodEnd?: Date;
@@ -38,7 +38,7 @@ export declare class Subjects {
38
38
  key: string;
39
39
  displayName?: string | null;
40
40
  metadata?: {
41
- [key: string]: unknown;
41
+ [key: string]: string;
42
42
  } | null;
43
43
  currentPeriodStart?: Date;
44
44
  currentPeriodEnd?: Date;
@@ -54,7 +54,7 @@ export declare class Subjects {
54
54
  key: string;
55
55
  displayName?: string | null;
56
56
  metadata?: {
57
- [key: string]: unknown;
57
+ [key: string]: string;
58
58
  } | null;
59
59
  currentPeriodStart?: Date;
60
60
  currentPeriodEnd?: Date;
@@ -8727,20 +8727,26 @@ exports.upsertSubjectBodyItem = zod_1.z
8727
8727
  currentPeriodEnd: zod_1.z
8728
8728
  .date()
8729
8729
  .optional()
8730
- .describe('[RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.'),
8730
+ .describe('The end of the current period for the subject.'),
8731
8731
  currentPeriodStart: zod_1.z
8732
8732
  .date()
8733
8733
  .optional()
8734
- .describe('[RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.'),
8734
+ .describe('The start of the current period for the subject.'),
8735
8735
  displayName: zod_1.z
8736
8736
  .string()
8737
8737
  .nullish()
8738
8738
  .describe('A human-readable display name for the subject.'),
8739
8739
  key: zod_1.z
8740
8740
  .string()
8741
- .describe('A unique, human-readable identifier for the subject.'),
8742
- metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).nullish(),
8743
- stripeCustomerId: zod_1.z.string().nullish(),
8741
+ .describe('A unique, human-readable identifier for the subject.\nThis is typically a database ID or a customer key.'),
8742
+ metadata: zod_1.z
8743
+ .record(zod_1.z.string(), zod_1.z.string())
8744
+ .nullish()
8745
+ .describe('Metadata for the subject.'),
8746
+ stripeCustomerId: zod_1.z
8747
+ .string()
8748
+ .nullish()
8749
+ .describe('The Stripe customer ID for the subject.'),
8744
8750
  })
8745
8751
  .describe('A subject is a unique identifier for a user or entity.');
8746
8752
  exports.upsertSubjectBody = zod_1.z.array(exports.upsertSubjectBodyItem);
@@ -14128,18 +14128,18 @@ export declare const upsertSubjectBodyItem: zod.ZodObject<{
14128
14128
  currentPeriodStart: zod.ZodOptional<zod.ZodDate>;
14129
14129
  displayName: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
14130
14130
  key: zod.ZodString;
14131
- metadata: zod.ZodOptional<zod.ZodNullable<zod.ZodRecord<zod.ZodString, zod.ZodAny>>>;
14131
+ metadata: zod.ZodOptional<zod.ZodNullable<zod.ZodRecord<zod.ZodString, zod.ZodString>>>;
14132
14132
  stripeCustomerId: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
14133
14133
  }, "strip", zod.ZodTypeAny, {
14134
14134
  key: string;
14135
- metadata?: Record<string, any> | null | undefined;
14135
+ metadata?: Record<string, string> | null | undefined;
14136
14136
  stripeCustomerId?: string | null | undefined;
14137
14137
  currentPeriodEnd?: Date | undefined;
14138
14138
  currentPeriodStart?: Date | undefined;
14139
14139
  displayName?: string | null | undefined;
14140
14140
  }, {
14141
14141
  key: string;
14142
- metadata?: Record<string, any> | null | undefined;
14142
+ metadata?: Record<string, string> | null | undefined;
14143
14143
  stripeCustomerId?: string | null | undefined;
14144
14144
  currentPeriodEnd?: Date | undefined;
14145
14145
  currentPeriodStart?: Date | undefined;
@@ -14150,18 +14150,18 @@ export declare const upsertSubjectBody: zod.ZodArray<zod.ZodObject<{
14150
14150
  currentPeriodStart: zod.ZodOptional<zod.ZodDate>;
14151
14151
  displayName: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
14152
14152
  key: zod.ZodString;
14153
- metadata: zod.ZodOptional<zod.ZodNullable<zod.ZodRecord<zod.ZodString, zod.ZodAny>>>;
14153
+ metadata: zod.ZodOptional<zod.ZodNullable<zod.ZodRecord<zod.ZodString, zod.ZodString>>>;
14154
14154
  stripeCustomerId: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
14155
14155
  }, "strip", zod.ZodTypeAny, {
14156
14156
  key: string;
14157
- metadata?: Record<string, any> | null | undefined;
14157
+ metadata?: Record<string, string> | null | undefined;
14158
14158
  stripeCustomerId?: string | null | undefined;
14159
14159
  currentPeriodEnd?: Date | undefined;
14160
14160
  currentPeriodStart?: Date | undefined;
14161
14161
  displayName?: string | null | undefined;
14162
14162
  }, {
14163
14163
  key: string;
14164
- metadata?: Record<string, any> | null | undefined;
14164
+ metadata?: Record<string, string> | null | undefined;
14165
14165
  stripeCustomerId?: string | null | undefined;
14166
14166
  currentPeriodEnd?: Date | undefined;
14167
14167
  currentPeriodStart?: Date | undefined;